mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
* 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
This commit is contained in:
@@ -98,27 +98,29 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
}
|
||||
terrainRenderer.Initialise(m_scene, m_config);
|
||||
|
||||
Bitmap mapbmp = new Bitmap((int)Constants.RegionSize, (int)Constants.RegionSize);
|
||||
//long t = System.Environment.TickCount;
|
||||
//for (int i = 0; i < 10; ++i) {
|
||||
using (Bitmap mapbmp = new Bitmap((int)Constants.RegionSize, (int)Constants.RegionSize))
|
||||
{
|
||||
//long t = System.Environment.TickCount;
|
||||
//for (int i = 0; i < 10; ++i) {
|
||||
terrainRenderer.TerrainToBitmap(mapbmp);
|
||||
//}
|
||||
//t = System.Environment.TickCount - t;
|
||||
//m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t);
|
||||
//}
|
||||
//t = System.Environment.TickCount - t;
|
||||
//m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t);
|
||||
|
||||
|
||||
if (drawPrimVolume)
|
||||
{
|
||||
DrawObjectVolume(m_scene, mapbmp);
|
||||
}
|
||||
if (drawPrimVolume)
|
||||
{
|
||||
DrawObjectVolume(m_scene, mapbmp);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
imageData = OpenJPEG.EncodeFromImage(mapbmp, true);
|
||||
}
|
||||
catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke
|
||||
{
|
||||
m_log.Error("Failed generating terrain map: " + e);
|
||||
try
|
||||
{
|
||||
imageData = OpenJPEG.EncodeFromImage(mapbmp, true);
|
||||
}
|
||||
catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke
|
||||
{
|
||||
m_log.Error("Failed generating terrain map: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
return imageData;
|
||||
|
||||
Reference in New Issue
Block a user