aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World
diff options
context:
space:
mode:
Diffstat (limited to '')
-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