diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs index 0364e7b..97ee451 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs | |||
@@ -306,15 +306,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
306 | 306 | ||
307 | double[,] hm = m_scene.Heightmap.GetDoubles(); | 307 | double[,] hm = m_scene.Heightmap.GetDoubles(); |
308 | 308 | ||
309 | for (int x = 0; x < 256; x++) | 309 | for (int x = 0; x < (int)Constants.RegionSize; x++) |
310 | { | 310 | { |
311 | float columnRatio = x / 255f; // 0 - 1, for interpolation | 311 | float columnRatio = x / ((float)Constants.RegionSize - 1); // 0 - 1, for interpolation |
312 | for (int y = 0; y < 256; y++) | 312 | for (int y = 0; y < (int)Constants.RegionSize; y++) |
313 | { | 313 | { |
314 | float rowRatio = y / 255f; // 0 - 1, for interpolation | 314 | float rowRatio = y / ((float)Constants.RegionSize - 1); // 0 - 1, for interpolation |
315 | 315 | ||
316 | // Y flip the cordinates for the bitmap: hf origin is lower left, bm origin is upper left | 316 | // Y flip the cordinates for the bitmap: hf origin is lower left, bm origin is upper left |
317 | int yr = 255 - y; | 317 | int yr = ((int)Constants.RegionSize - 1) - y; |
318 | 318 | ||
319 | float heightvalue = getHeight(hm, x, y); | 319 | float heightvalue = getHeight(hm, x, y); |
320 | if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue)) | 320 | if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue)) |
@@ -366,7 +366,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
366 | } | 366 | } |
367 | 367 | ||
368 | // Shade the terrain for shadows | 368 | // Shade the terrain for shadows |
369 | if (x < 255 && y < 255) | 369 | if (x < ((int)Constants.RegionSize - 1) && y < ((int)Constants.RegionSize - 1)) |
370 | { | 370 | { |
371 | float hfvaluecompare = getHeight(hm, x + 1, y + 1); // light from north-east => look at land height there | 371 | float hfvaluecompare = getHeight(hm, x + 1, y + 1); // light from north-east => look at land height there |
372 | if (Single.IsInfinity(hfvaluecompare) || Single.IsNaN(hfvaluecompare)) | 372 | if (Single.IsInfinity(hfvaluecompare) || Single.IsNaN(hfvaluecompare)) |