aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-08-07 18:40:56 -0400
committerTeravus Ovares (Dan Olivares)2009-08-07 18:40:56 -0400
commitc8a68fb3fbac0d99b53a62bb062232c0d5695d3c (patch)
treebb010e480b095e48cd80fce04305f5e8cd290a3b /OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs
parentSilly error, simple fix (diff)
downloadopensim-SC_OLD-c8a68fb3fbac0d99b53a62bb062232c0d5695d3c.zip
opensim-SC_OLD-c8a68fb3fbac0d99b53a62bb062232c0d5695d3c.tar.gz
opensim-SC_OLD-c8a68fb3fbac0d99b53a62bb062232c0d5695d3c.tar.bz2
opensim-SC_OLD-c8a68fb3fbac0d99b53a62bb062232c0d5695d3c.tar.xz
* Remove hard coded 256 limitations from various places. There's no more 256m limitation within the OpenSimulator framework, however, the LLClient ClientView does not support regions larger then 256 meters so, if you try and make your region larger by setting Constants.RegionSize = 512; in OpenSim.Framework.Constants.cs, the terrain will not display on clients using the LLUDP protocol
Diffstat (limited to '')
-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 }