aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJak Daniels2014-03-17 20:39:36 +0000
committerRobert Adams2014-03-18 22:18:50 -0700
commit61353dde80a3912e26959c612a1d8d46ec1bc826 (patch)
tree3a78615a34b53a5e0201b4e570006f09a6745cc1 /OpenSim/Region
parentRevert "Simplify DoubleQueue to eliminate redundant sempahore work." (diff)
downloadopensim-SC_OLD-61353dde80a3912e26959c612a1d8d46ec1bc826.zip
opensim-SC_OLD-61353dde80a3912e26959c612a1d8d46ec1bc826.tar.gz
opensim-SC_OLD-61353dde80a3912e26959c612a1d8d46ec1bc826.tar.bz2
opensim-SC_OLD-61353dde80a3912e26959c612a1d8d46ec1bc826.tar.xz
Allow Region specific static maptiles to be loaded from file.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs53
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs3
2 files changed, 37 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
index 1dad8ba..0bd6ae4 100644
--- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
@@ -91,29 +91,46 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
91 91
92 if (generateMaptiles) 92 if (generateMaptiles)
93 { 93 {
94 if (textureTerrain) 94 if (String.IsNullOrEmpty(m_scene.RegionInfo.m_maptileStaticFile))
95 { 95 {
96 terrainRenderer = new TexturedMapTileRenderer(); 96 if (textureTerrain)
97 } 97 {
98 else 98 terrainRenderer = new TexturedMapTileRenderer();
99 { 99 }
100 terrainRenderer = new ShadedMapTileRenderer(); 100 else
101 } 101 {
102 terrainRenderer = new ShadedMapTileRenderer();
103 }
102 104
103 terrainRenderer.Initialise(m_scene, m_config); 105 terrainRenderer.Initialise(m_scene, m_config);
104 106
105 mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height, 107 mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height,
106 System.Drawing.Imaging.PixelFormat.Format24bppRgb); 108 System.Drawing.Imaging.PixelFormat.Format24bppRgb);
107 //long t = System.Environment.TickCount; 109 //long t = System.Environment.TickCount;
108 //for (int i = 0; i < 10; ++i) { 110 //for (int i = 0; i < 10; ++i) {
109 terrainRenderer.TerrainToBitmap(mapbmp); 111 terrainRenderer.TerrainToBitmap(mapbmp);
110 //} 112 //}
111 //t = System.Environment.TickCount - t; 113 //t = System.Environment.TickCount - t;
112 //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t); 114 //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t);
113 115
114 if (drawPrimVolume) 116 if (drawPrimVolume)
117 {
118 DrawObjectVolume(m_scene, mapbmp);
119 }
120 }
121 else
115 { 122 {
116 DrawObjectVolume(m_scene, mapbmp); 123 try
124 {
125 mapbmp = new Bitmap("maptiles/" + m_scene.RegionInfo.m_maptileStaticFile);
126 }
127 catch (Exception e)
128 {
129 m_log.ErrorFormat("[MAPTILE]: Failed to load Static map image texture file: {0} for {1}", "maptiles/" + m_scene.RegionInfo.m_maptileStaticFile, m_scene.Name);
130 //mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
131 mapbmp = null;
132 }
133 if (mapbmp != null) m_log.DebugFormat("[MAPTILE]: Static map image texture file {0} found for {1}", "maptiles/" + m_scene.RegionInfo.m_maptileStaticFile, m_scene.Name);
117 } 134 }
118 } 135 }
119 else 136 else
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index fa90ef4..d16b73b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -903,7 +903,8 @@ namespace OpenSim.Region.Framework.Scenes
903 903
904 if (m_generateMaptiles) 904 if (m_generateMaptiles)
905 { 905 {
906 int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0); 906 int maptileRefresh = Util.GetConfigVarFromSections<int>(config, "MaptileRefresh", possibleMapConfigSections, 0);
907 m_log.InfoFormat("[SCENE]: Region {0}, WORLD MAP refresh time set to {1} seconds", RegionInfo.RegionName, maptileRefresh);
907 if (maptileRefresh != 0) 908 if (maptileRefresh != 0)
908 { 909 {
909 m_mapGenerationTimer.Interval = maptileRefresh * 1000; 910 m_mapGenerationTimer.Interval = maptileRefresh * 1000;