diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs index 5fd8369..285d36a 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs | |||
@@ -98,27 +98,29 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
98 | } | 98 | } |
99 | terrainRenderer.Initialise(m_scene, m_config); | 99 | terrainRenderer.Initialise(m_scene, m_config); |
100 | 100 | ||
101 | Bitmap mapbmp = new Bitmap((int)Constants.RegionSize, (int)Constants.RegionSize); | 101 | using (Bitmap mapbmp = new Bitmap((int)Constants.RegionSize, (int)Constants.RegionSize)) |
102 | //long t = System.Environment.TickCount; | 102 | { |
103 | //for (int i = 0; i < 10; ++i) { | 103 | //long t = System.Environment.TickCount; |
104 | //for (int i = 0; i < 10; ++i) { | ||
104 | terrainRenderer.TerrainToBitmap(mapbmp); | 105 | terrainRenderer.TerrainToBitmap(mapbmp); |
105 | //} | 106 | //} |
106 | //t = System.Environment.TickCount - t; | 107 | //t = System.Environment.TickCount - t; |
107 | //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t); | 108 | //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t); |
108 | 109 | ||
109 | 110 | ||
110 | if (drawPrimVolume) | 111 | if (drawPrimVolume) |
111 | { | 112 | { |
112 | DrawObjectVolume(m_scene, mapbmp); | 113 | DrawObjectVolume(m_scene, mapbmp); |
113 | } | 114 | } |
114 | 115 | ||
115 | try | 116 | try |
116 | { | 117 | { |
117 | imageData = OpenJPEG.EncodeFromImage(mapbmp, true); | 118 | imageData = OpenJPEG.EncodeFromImage(mapbmp, true); |
118 | } | 119 | } |
119 | catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke | 120 | catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke |
120 | { | 121 | { |
121 | m_log.Error("Failed generating terrain map: " + e); | 122 | m_log.Error("Failed generating terrain map: " + e); |
123 | } | ||
122 | } | 124 | } |
123 | 125 | ||
124 | return imageData; | 126 | return imageData; |