aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs17
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs
index 1836026..f39cf68 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs
@@ -30,6 +30,7 @@ using System.Drawing;
30using System.Reflection; 30using System.Reflection;
31using log4net; 31using log4net;
32using Nini.Config; 32using Nini.Config;
33using OpenSim.Framework;
33using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
34 35
35namespace OpenSim.Region.CoreModules.World.WorldMap 36namespace OpenSim.Region.CoreModules.World.WorldMap
@@ -60,9 +61,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
60 61
61 float low = 255; 62 float low = 255;
62 float high = 0; 63 float high = 0;
63 for (int x = 0; x < 256; x++) 64 for (int x = 0; x < (int)Constants.RegionSize; x++)
64 { 65 {
65 for (int y = 0; y < 256; y++) 66 for (int y = 0; y < (int)Constants.RegionSize; y++)
66 { 67 {
67 float hmval = (float)hm[x, y]; 68 float hmval = (float)hm[x, y];
68 if (hmval < low) 69 if (hmval < low)
@@ -74,12 +75,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
74 75
75 float waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; 76 float waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight;
76 77
77 for (int x = 0; x < 256; x++) 78 for (int x = 0; x < (int)Constants.RegionSize; x++)
78 { 79 {
79 for (int y = 0; y < 256; y++) 80 for (int y = 0; y < (int)Constants.RegionSize; y++)
80 { 81 {
81 // Y flip the cordinates for the bitmap: hf origin is lower left, bm origin is upper left 82 // Y flip the cordinates for the bitmap: hf origin is lower left, bm origin is upper left
82 int yr = 255 - y; 83 int yr = ((int)Constants.RegionSize - 1) - y;
83 84
84 float heightvalue = (float)hm[x, y]; 85 float heightvalue = (float)hm[x, y];
85 86
@@ -111,7 +112,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
111 float hfvalue = (float)hm[x, y]; 112 float hfvalue = (float)hm[x, y];
112 float hfvaluecompare = 0f; 113 float hfvaluecompare = 0f;
113 114
114 if ((x + 1 < 256) && (y + 1 < 256)) 115 if ((x + 1 < (int)Constants.RegionSize) && (y + 1 < (int)Constants.RegionSize))
115 { 116 {
116 hfvaluecompare = (float)hm[x + 1, y + 1]; // light from north-east => look at land height there 117 hfvaluecompare = (float)hm[x + 1, y + 1]; // light from north-east => look at land height there
117 } 118 }
@@ -176,7 +177,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
176 177
177 if (ShadowDebugContinue) 178 if (ShadowDebugContinue)
178 { 179 {
179 if ((x - 1 > 0) && (yr + 1 < 256)) 180 if ((x - 1 > 0) && (yr + 1 < (int)Constants.RegionSize))
180 { 181 {
181 color = mapbmp.GetPixel(x - 1, yr + 1); 182 color = mapbmp.GetPixel(x - 1, yr + 1);
182 int r = color.R; 183 int r = color.R;
@@ -231,7 +232,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
231 terraincorruptedwarningsaid = true; 232 terraincorruptedwarningsaid = true;
232 } 233 }
233 Color black = Color.Black; 234 Color black = Color.Black;
234 mapbmp.SetPixel(x, (256 - y) - 1, black); 235 mapbmp.SetPixel(x, ((int)Constants.RegionSize - y) - 1, black);
235 } 236 }
236 } 237 }
237 } 238 }