aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/WorldMap
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/WorldMap')
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs17
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs12
3 files changed, 17 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
index 7afada3..d1d3045 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
@@ -33,6 +33,7 @@ using log4net;
33using Nini.Config; 33using Nini.Config;
34using OpenMetaverse; 34using OpenMetaverse;
35using OpenMetaverse.Imaging; 35using OpenMetaverse.Imaging;
36using OpenSim.Framework;
36using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
37using OpenSim.Region.Framework.Scenes; 38using OpenSim.Region.Framework.Scenes;
38 39
@@ -97,7 +98,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
97 } 98 }
98 terrainRenderer.Initialise(m_scene, m_config); 99 terrainRenderer.Initialise(m_scene, m_config);
99 100
100 Bitmap mapbmp = new Bitmap(256, 256); 101 Bitmap mapbmp = new Bitmap((int)Constants.RegionSize, (int)Constants.RegionSize);
101 //long t = System.Environment.TickCount; 102 //long t = System.Environment.TickCount;
102 //for (int i = 0; i < 10; ++i) { 103 //for (int i = 0; i < 10; ++i) {
103 terrainRenderer.TerrainToBitmap(mapbmp); 104 terrainRenderer.TerrainToBitmap(mapbmp);
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 }
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))