aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-10 16:50:11 +0000
committerJustin Clarke Casey2008-12-10 16:50:11 +0000
commit9e02a639e563ef45788ae24adf568be028e041be (patch)
treebad5d8c7c441db50b2414b8ec77cc93bebc2fbdf /OpenSim/Region
parentApplying diva's revert patch. Reverts closing child agents and makes (diff)
downloadopensim-SC-9e02a639e563ef45788ae24adf568be028e041be.zip
opensim-SC-9e02a639e563ef45788ae24adf568be028e041be.tar.gz
opensim-SC-9e02a639e563ef45788ae24adf568be028e041be.tar.bz2
opensim-SC-9e02a639e563ef45788ae24adf568be028e041be.tar.xz
* Apply the other patch from http://opensimulator.org/mantis/view.php?id=2315
* This means that LL RAW terrains (one source being the upload/download buttons on the estate dialog in the viewer) are now imported the 'right' way around rather than being flipped on the y axis * Existing RAW terrains before this patch will need to be flipped with the "terrain flip y" command from the console after import * More details on the mailing lists soon. -This line, and those below, will be ignored-- M OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs M OpenSim/Framework/Communications/Cache/CachedUserInfo.cs M OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
index 5f13d01..88dd3a7 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/LLRAW.cs
@@ -88,23 +88,23 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
88 FileStream s = file.Open(FileMode.Open, FileAccess.Read); 88 FileStream s = file.Open(FileMode.Open, FileAccess.Read);
89 BinaryReader bs = new BinaryReader(s); 89 BinaryReader bs = new BinaryReader(s);
90 90
91 int currFileYOffset = 0; 91 int currFileYOffset = fileHeight - 1;
92 92
93 // if our region isn't on the first Y section of the areas to be landscaped, then 93 // if our region isn't on the first Y section of the areas to be landscaped, then
94 // advance to our section of the file 94 // advance to our section of the file
95 while (currFileYOffset < offsetY) 95 while (currFileYOffset > offsetY)
96 { 96 {
97 // read a whole strip of regions 97 // read a whole strip of regions
98 int heightsToRead = sectionHeight * (fileWidth * sectionWidth); 98 int heightsToRead = sectionHeight * (fileWidth * sectionWidth);
99 bs.ReadBytes(heightsToRead * 13); // because there are 13 fun channels 99 bs.ReadBytes(heightsToRead * 13); // because there are 13 fun channels
100 currFileYOffset++; 100 currFileYOffset--;
101 } 101 }
102 102
103 // got to the Y start offset within the file of our region 103 // got to the Y start offset within the file of our region
104 // so read the file bits associated with our region 104 // so read the file bits associated with our region
105 int y; 105 int y;
106 // for each Y within our Y offset 106 // for each Y within our Y offset
107 for (y = 0; y < sectionHeight; y++) 107 for (y = sectionHeight - 1; y >= 0; y--)
108 { 108 {
109 int currFileXOffset = 0; 109 int currFileXOffset = 0;
110 110
@@ -155,7 +155,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
155 int x; 155 int x;
156 for (x = 0; x < retval.Width; x++) 156 for (x = 0; x < retval.Width; x++)
157 { 157 {
158 retval[x, y] = bs.ReadByte() * (bs.ReadByte() / 128.0); 158 retval[x, (retval.Height - 1) - y] = bs.ReadByte() * (bs.ReadByte() / 128.0);
159 bs.ReadBytes(11); // Advance the stream to next bytes. 159 bs.ReadBytes(11); // Advance the stream to next bytes.
160 } 160 }
161 } 161 }
@@ -183,7 +183,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
183 { 183 {
184 for (int x = 0; x < map.Width; x++) 184 for (int x = 0; x < map.Width; x++)
185 { 185 {
186 double t = map[x, y]; 186 double t = map[x, (map.Height - 1) - y];
187 int index = 0; 187 int index = 0;
188 188
189 // The lookup table is pre-sorted, so we either find an exact match or 189 // The lookup table is pre-sorted, so we either find an exact match or