aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-23 14:22:21 -0700
committerJohn Hurliman2009-10-23 14:22:21 -0700
commit2c34619aea074446e53dde80d397973075914bac (patch)
tree57dc6b70a33df038b334e8632caa084c02ded5ce /OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs
parent* Change the way Util.FireAndForget() calls SmartThreadPool to avoid using a ... (diff)
downloadopensim-SC_OLD-2c34619aea074446e53dde80d397973075914bac.zip
opensim-SC_OLD-2c34619aea074446e53dde80d397973075914bac.tar.gz
opensim-SC_OLD-2c34619aea074446e53dde80d397973075914bac.tar.bz2
opensim-SC_OLD-2c34619aea074446e53dde80d397973075914bac.tar.xz
* Changed various modules to not initialize timers unless the module is initialized. Ideally, the timers would not initialize unless the module was actually enabled, but Melanie's work on configuring module loading from a config file should make that unnecessary
* Wrapped the Bitmap class used to generate the world map tile in a using statement to dispose of it after the JPEG2000 data is created
Diffstat (limited to 'OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs36
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;