aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/LegacyMap
diff options
context:
space:
mode:
authorUbitUmarov2015-09-01 14:54:35 +0100
committerUbitUmarov2015-09-01 14:54:35 +0100
commit371c9dd2af01a2e7422ec901ee1f80757284a78c (patch)
tree058d2a513cacb12efcce0c0df0ae14ad135dbfe2 /OpenSim/Region/CoreModules/World/LegacyMap
parentremove lixo (diff)
parentdont change camera on crossings (diff)
downloadopensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.zip
opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.gz
opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.bz2
opensim-SC_OLD-371c9dd2af01a2e7422ec901ee1f80757284a78c.tar.xz
bad merge?
Diffstat (limited to 'OpenSim/Region/CoreModules/World/LegacyMap')
-rw-r--r--OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs11
-rw-r--r--OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs18
2 files changed, 27 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
index 796a15f..a228e7a 100644
--- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
@@ -104,6 +104,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
104 104
105 terrainRenderer.Initialise(m_scene, m_config); 105 terrainRenderer.Initialise(m_scene, m_config);
106 106
107<<<<<<< HEAD
107 mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height, 108 mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height,
108 System.Drawing.Imaging.PixelFormat.Format24bppRgb); 109 System.Drawing.Imaging.PixelFormat.Format24bppRgb);
109 //long t = System.Environment.TickCount; 110 //long t = System.Environment.TickCount;
@@ -112,6 +113,16 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
112 //} 113 //}
113 //t = System.Environment.TickCount - t; 114 //t = System.Environment.TickCount - t;
114 //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t); 115 //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t);
116=======
117 mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height,
118 System.Drawing.Imaging.PixelFormat.Format24bppRgb);
119 //long t = System.Environment.TickCount;
120 //for (int i = 0; i < 10; ++i) {
121 terrainRenderer.TerrainToBitmap(mapbmp);
122 //}
123 //t = System.Environment.TickCount - t;
124 //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t);
125>>>>>>> avn/ubitvar
115 126
116 if (drawPrimVolume) 127 if (drawPrimVolume)
117 { 128 {
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs
index 9f23141..a9cc993 100644
--- a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs
+++ b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs
@@ -270,8 +270,14 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
270 270
271 // the heigthfield might have some jumps in values. Rendered land is smooth, though, 271 // the heigthfield might have some jumps in values. Rendered land is smooth, though,
272 // as a slope is rendered at that place. So average 4 neighbour values to emulate that. 272 // as a slope is rendered at that place. So average 4 neighbour values to emulate that.
273<<<<<<< HEAD
273 private float getHeight(ITerrainChannel hm, int x, int y) { 274 private float getHeight(ITerrainChannel hm, int x, int y) {
274 if (x < (hm.Width - 1) && y < (hm.Height - 1)) 275 if (x < (hm.Width - 1) && y < (hm.Height - 1))
276=======
277 private float getHeight(ITerrainChannel hm, int x, int y)
278 {
279 if (x < ((int)Constants.RegionSize - 1) && y < ((int)Constants.RegionSize - 1))
280>>>>>>> avn/ubitvar
275 return (float)(hm[x, y] * .444 + (hm[x + 1, y] + hm[x, y + 1]) * .222 + hm[x + 1, y +1] * .112); 281 return (float)(hm[x, y] * .444 + (hm[x + 1, y] + hm[x, y + 1]) * .222 + hm[x + 1, y +1] * .112);
276 else 282 else
277 return (float)hm[x, y]; 283 return (float)hm[x, y];
@@ -291,6 +297,14 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
291 LogHeader, mapbmp.Width, mapbmp.Height, hm.Width, hm.Height); 297 LogHeader, mapbmp.Width, mapbmp.Height, hm.Width, hm.Height);
292 } 298 }
293 299
300 ITerrainChannel hm = m_scene.Heightmap;
301
302 if (mapbmp.Width != hm.Width || mapbmp.Height != hm.Height)
303 {
304 m_log.ErrorFormat("{0} TerrainToBitmap. Passed bitmap wrong dimensions. passed=<{1},{2}>, size=<{3},{4}>",
305 "[TEXTURED MAP TILE RENDERER]", mapbmp.Width, mapbmp.Height, hm.Width, hm.Height);
306 }
307
294 // These textures should be in the AssetCache anyway, as every client conneting to this 308 // These textures should be in the AssetCache anyway, as every client conneting to this
295 // region needs them. Except on start, when the map is recreated (before anyone connected), 309 // region needs them. Except on start, when the map is recreated (before anyone connected),
296 // and on change of the estate settings (textures and terrain values), when the map should 310 // and on change of the estate settings (textures and terrain values), when the map should
@@ -371,8 +385,8 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
371 // first, rescale h to 0.0 - 1.0 385 // first, rescale h to 0.0 - 1.0
372 hmod = (hmod - low) / (high - low); 386 hmod = (hmod - low) / (high - low);
373 // now we have to split: 0.00 => color1, 0.33 => color2, 0.67 => color3, 1.00 => color4 387 // now we have to split: 0.00 => color1, 0.33 => color2, 0.67 => color3, 1.00 => color4
374 if (hmod < 1f/3f) hsv = interpolateHSV(ref hsv1, ref hsv2, hmod * 3f); 388 if (hmod < 1f / 3f) hsv = interpolateHSV(ref hsv1, ref hsv2, hmod * 3f);
375 else if (hmod < 2f/3f) hsv = interpolateHSV(ref hsv2, ref hsv3, (hmod * 3f) - 1f); 389 else if (hmod < 2f / 3f) hsv = interpolateHSV(ref hsv2, ref hsv3, (hmod * 3f) - 1f);
376 else hsv = interpolateHSV(ref hsv3, ref hsv4, (hmod * 3f) - 2f); 390 else hsv = interpolateHSV(ref hsv3, ref hsv4, (hmod * 3f) - 2f);
377 } 391 }
378 392