diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 3708fff..6b2407a 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -223,6 +223,21 @@ namespace OpenSim.Region.Communications.OGS1 | |||
223 | /// <returns></returns> | 223 | /// <returns></returns> |
224 | public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) | 224 | public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) |
225 | { | 225 | { |
226 | int temp = 0; | ||
227 | |||
228 | if (minX > maxX) | ||
229 | { | ||
230 | temp = minX; | ||
231 | minX = maxX; | ||
232 | maxX = temp; | ||
233 | } | ||
234 | if (minY > maxY) | ||
235 | { | ||
236 | temp = minY; | ||
237 | minY = maxY; | ||
238 | maxY = temp; | ||
239 | } | ||
240 | |||
226 | Hashtable respData = MapBlockQuery(minX, minY, maxX, maxY); | 241 | Hashtable respData = MapBlockQuery(minX, minY, maxX, maxY); |
227 | 242 | ||
228 | List<MapBlockData> neighbours = new List<MapBlockData>(); | 243 | List<MapBlockData> neighbours = new List<MapBlockData>(); |
diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs index bbbb4d7..4ff22fb 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs | |||
@@ -1261,13 +1261,13 @@ namespace OpenSim.Region.Terrain | |||
1261 | } | 1261 | } |
1262 | 1262 | ||
1263 | Channel copy = heightmap.Copy(); | 1263 | Channel copy = heightmap.Copy(); |
1264 | for (int y = 0; y < copy.h; y++) | 1264 | for (int y = 0; y <copy.h; y++) |
1265 | { | 1265 | { |
1266 | for (int x = 0; x < copy.w; x++) | 1266 | for (int x = 0; x < copy.w; x++) |
1267 | { | 1267 | { |
1268 | // 512 is the largest possible height before colours clamp | 1268 | // 512 is the largest possible height before colours clamp |
1269 | int colorindex = (int) (Math.Max(Math.Min(1.0, copy.Get(x, y)/512.0), 0.0)*(pallete - 1)); | 1269 | int colorindex = (int) (Math.Max(Math.Min(1.0, copy.Get(x, y)/512.0), 0.0)*(pallete - 1)); |
1270 | bmp.SetPixel(x, y, colours[colorindex]); | 1270 | bmp.SetPixel(x, copy.h-y-1, colours[colorindex]); |
1271 | } | 1271 | } |
1272 | } | 1272 | } |
1273 | return bmp; | 1273 | return bmp; |