diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs index 796a15f..1e63662 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs | |||
@@ -73,6 +73,10 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
73 | 73 | ||
74 | #region IMapImageGenerator Members | 74 | #region IMapImageGenerator Members |
75 | 75 | ||
76 | public Bitmap CreateMapTileForce() | ||
77 | { | ||
78 | return CreateMapTile(); | ||
79 | } | ||
76 | public Bitmap CreateMapTile() | 80 | public Bitmap CreateMapTile() |
77 | { | 81 | { |
78 | bool drawPrimVolume = true; | 82 | bool drawPrimVolume = true; |
@@ -82,11 +86,11 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
82 | 86 | ||
83 | string[] configSections = new string[] { "Map", "Startup" }; | 87 | string[] configSections = new string[] { "Map", "Startup" }; |
84 | 88 | ||
85 | drawPrimVolume | 89 | drawPrimVolume |
86 | = Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume); | 90 | = Util.GetConfigVarFromSections<bool>(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume); |
87 | textureTerrain | 91 | textureTerrain |
88 | = Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, textureTerrain); | 92 | = Util.GetConfigVarFromSections<bool>(m_config, "TextureOnMapTile", configSections, textureTerrain); |
89 | generateMaptiles | 93 | generateMaptiles |
90 | = Util.GetConfigVarFromSections<bool>(m_config, "GenerateMaptiles", configSections, generateMaptiles); | 94 | = Util.GetConfigVarFromSections<bool>(m_config, "GenerateMaptiles", configSections, generateMaptiles); |
91 | 95 | ||
92 | if (generateMaptiles) | 96 | if (generateMaptiles) |
@@ -112,7 +116,6 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
112 | //} | 116 | //} |
113 | //t = System.Environment.TickCount - t; | 117 | //t = System.Environment.TickCount - t; |
114 | //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t); | 118 | //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t); |
115 | |||
116 | if (drawPrimVolume) | 119 | if (drawPrimVolume) |
117 | { | 120 | { |
118 | DrawObjectVolume(m_scene, mapbmp); | 121 | DrawObjectVolume(m_scene, mapbmp); |
@@ -127,15 +130,15 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
127 | catch (Exception) | 130 | catch (Exception) |
128 | { | 131 | { |
129 | m_log.ErrorFormat( | 132 | m_log.ErrorFormat( |
130 | "[MAPTILE]: Failed to load Static map image texture file: {0} for {1}", | 133 | "[MAPTILE]: Failed to load Static map image texture file: {0} for {1}", |
131 | m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); | 134 | m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); |
132 | //mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); | 135 | //mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); |
133 | mapbmp = null; | 136 | mapbmp = null; |
134 | } | 137 | } |
135 | 138 | ||
136 | if (mapbmp != null) | 139 | if (mapbmp != null) |
137 | m_log.DebugFormat( | 140 | m_log.DebugFormat( |
138 | "[MAPTILE]: Static map image texture file {0} found for {1}", | 141 | "[MAPTILE]: Static map image texture file {0} found for {1}", |
139 | m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); | 142 | m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); |
140 | } | 143 | } |
141 | } | 144 | } |
@@ -309,7 +312,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
309 | List<uint> z_localIDs = new List<uint>(); | 312 | List<uint> z_localIDs = new List<uint>(); |
310 | Dictionary<uint, DrawStruct> z_sort = new Dictionary<uint, DrawStruct>(); | 313 | Dictionary<uint, DrawStruct> z_sort = new Dictionary<uint, DrawStruct>(); |
311 | 314 | ||
312 | try | 315 | try |
313 | { | 316 | { |
314 | lock (objs) | 317 | lock (objs) |
315 | { | 318 | { |
@@ -383,7 +386,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
383 | 386 | ||
384 | Vector3 pos = part.GetWorldPosition(); | 387 | Vector3 pos = part.GetWorldPosition(); |
385 | 388 | ||
386 | // skip prim outside of retion | 389 | // skip prim outside of region |
387 | if (!m_scene.PositionIsInCurrentRegion(pos)) | 390 | if (!m_scene.PositionIsInCurrentRegion(pos)) |
388 | continue; | 391 | continue; |
389 | 392 | ||
@@ -407,12 +410,13 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
407 | { | 410 | { |
408 | // Translate scale by rotation so scale is represented properly when object is rotated | 411 | // Translate scale by rotation so scale is represented properly when object is rotated |
409 | Vector3 lscale = new Vector3(part.Shape.Scale.X, part.Shape.Scale.Y, part.Shape.Scale.Z); | 412 | Vector3 lscale = new Vector3(part.Shape.Scale.X, part.Shape.Scale.Y, part.Shape.Scale.Z); |
413 | lscale *= 0.5f; | ||
414 | |||
410 | Vector3 scale = new Vector3(); | 415 | Vector3 scale = new Vector3(); |
411 | Vector3 tScale = new Vector3(); | 416 | Vector3 tScale = new Vector3(); |
412 | Vector3 axPos = new Vector3(pos.X, pos.Y, pos.Z); | 417 | Vector3 axPos = new Vector3(pos.X, pos.Y, pos.Z); |
413 | 418 | ||
414 | Quaternion llrot = part.GetWorldRotation(); | 419 | Quaternion rot = part.GetWorldRotation(); |
415 | Quaternion rot = new Quaternion(llrot.W, llrot.X, llrot.Y, llrot.Z); | ||
416 | scale = lscale * rot; | 420 | scale = lscale * rot; |
417 | 421 | ||
418 | // negative scales don't work in this situation | 422 | // negative scales don't work in this situation |
@@ -471,7 +475,6 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
471 | 475 | ||
472 | tScale = new Vector3(lscale.X, -lscale.Y, -lscale.Z); | 476 | tScale = new Vector3(lscale.X, -lscale.Y, -lscale.Z); |
473 | scale = ((tScale * rot)); | 477 | scale = ((tScale * rot)); |
474 | |||
475 | vertexes[2] = (new Vector3((pos.X + scale.X), (pos.Y + scale.Y), (pos.Z + scale.Z))); | 478 | vertexes[2] = (new Vector3((pos.X + scale.X), (pos.Y + scale.Y), (pos.Z + scale.Z))); |
476 | 479 | ||
477 | //vertexes[2].x = pos.X + vertexes[2].x; | 480 | //vertexes[2].x = pos.X + vertexes[2].x; |