diff options
Diffstat (limited to 'OpenSim')
5 files changed, 51 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs index ce82c26..f45161d 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs | |||
@@ -73,6 +73,11 @@ 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 | } | ||
80 | |||
76 | public Bitmap CreateMapTile() | 81 | public Bitmap CreateMapTile() |
77 | { | 82 | { |
78 | bool drawPrimVolume = true; | 83 | bool drawPrimVolume = true; |
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs index ce5e167..fc09f32 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs | |||
@@ -149,9 +149,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
149 | 149 | ||
150 | List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); | 150 | List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); |
151 | if (renderers.Count > 0) | 151 | if (renderers.Count > 0) |
152 | m_log.Info("[MAPTILE]: Loaded prim mesher " + renderers[0]); | 152 | m_log.Info("[WARP 3D IMAGE MODULE]: Loaded prim mesher " + renderers[0]); |
153 | else | 153 | else |
154 | m_log.Info("[MAPTILE]: No prim mesher loaded, prim rendering will be disabled"); | 154 | m_log.Info("[WARP 3D IMAGE MODULE]: No prim mesher loaded, prim rendering will be disabled"); |
155 | 155 | ||
156 | m_scene.RegisterModuleInterface<IMapImageGenerator>(this); | 156 | m_scene.RegisterModuleInterface<IMapImageGenerator>(this); |
157 | } | 157 | } |
@@ -193,6 +193,13 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
193 | private float fov; | 193 | private float fov; |
194 | private bool orto; | 194 | private bool orto; |
195 | 195 | ||
196 | public Bitmap CreateMapTileForce() | ||
197 | { | ||
198 | m_log.Info("[WARP 3D IMAGE MODULE]: Forcing a map tile regenerate."); | ||
199 | File.Delete(System.IO.Path.Combine(m_cacheDirectory,"MAP-" + m_scene.RegionInfo.RegionID.ToString() + ".png")); | ||
200 | return CreateMapTile(); | ||
201 | } | ||
202 | |||
196 | public Bitmap CreateMapTile() | 203 | public Bitmap CreateMapTile() |
197 | { | 204 | { |
198 | List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); | 205 | List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); |
@@ -217,6 +224,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
217 | Bitmap tile = GenImage(); | 224 | Bitmap tile = GenImage(); |
218 | // image may be reloaded elsewhere, so no compression format | 225 | // image may be reloaded elsewhere, so no compression format |
219 | string filename = System.IO.Path.Combine(m_cacheDirectory,"MAP-" + m_scene.RegionInfo.RegionID.ToString() + ".png"); | 226 | string filename = System.IO.Path.Combine(m_cacheDirectory,"MAP-" + m_scene.RegionInfo.RegionID.ToString() + ".png"); |
227 | m_log.Info("[WARP 3D IMAGE MODULE]: Generating map tile " + filename); | ||
220 | tile.Save(filename, ImageFormat.Png); | 228 | tile.Save(filename, ImageFormat.Png); |
221 | m_primMesher = null; | 229 | m_primMesher = null; |
222 | return tile; | 230 | return tile; |
@@ -549,7 +557,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
549 | } | 557 | } |
550 | else | 558 | else |
551 | { | 559 | { |
552 | m_log.WarnFormat("[Warp3D] failed to get mesh or sculpt asset {0} of prim {1} at {2}", | 560 | m_log.WarnFormat("[WARP 3D IMAGE MODULE] failed to get mesh or sculpt asset {0} of prim {1} at {2}", |
553 | omvPrim.Sculpt.SculptTexture.ToString(), prim.Name, prim.GetWorldPosition().ToString()); | 561 | omvPrim.Sculpt.SculptTexture.ToString(), prim.Name, prim.GetWorldPosition().ToString()); |
554 | } | 562 | } |
555 | } | 563 | } |
@@ -805,11 +813,11 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
805 | } | 813 | } |
806 | catch (Exception e) | 814 | catch (Exception e) |
807 | { | 815 | { |
808 | m_log.WarnFormat("[Warp3D]: Failed to decode texture {0} for prim {1} at {2}, exception {3}", id.ToString(), sop.Name, sop.GetWorldPosition().ToString(), e.Message); | 816 | m_log.WarnFormat("[WARP 3D IMAGE MODULE]: Failed to decode texture {0} for prim {1} at {2}, exception {3}", id.ToString(), sop.Name, sop.GetWorldPosition().ToString(), e.Message); |
809 | } | 817 | } |
810 | } | 818 | } |
811 | else | 819 | else |
812 | m_log.WarnFormat("[Warp3D]: missing texture {0} data for prim {1} at {2}", | 820 | m_log.WarnFormat("[WARP 3D IMAGE MODULE]: missing texture {0} data for prim {1} at {2}", |
813 | id.ToString(), sop.Name, sop.GetWorldPosition().ToString()); | 821 | id.ToString(), sop.Name, sop.GetWorldPosition().ToString()); |
814 | 822 | ||
815 | m_warpTextures[id.ToString()] = ret; | 823 | m_warpTextures[id.ToString()] = ret; |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 1dab18e..1d71857 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -1545,7 +1545,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1545 | if (consoleScene != null && consoleScene != m_scene) | 1545 | if (consoleScene != null && consoleScene != m_scene) |
1546 | return; | 1546 | return; |
1547 | 1547 | ||
1548 | m_scene.RegenerateMaptileAndReregister(this, null); | 1548 | GenerateMaptileForce(); |
1549 | //// This used to be GenerateMaptile(); | ||
1550 | //// m_scene.RegenerateMaptileAndReregister(this, null); | ||
1549 | } | 1551 | } |
1550 | 1552 | ||
1551 | public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint) | 1553 | public OSD HandleRemoteMapItemRequest(string path, OSD request, string endpoint) |
@@ -1661,6 +1663,28 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1661 | return responsemap; | 1663 | return responsemap; |
1662 | } | 1664 | } |
1663 | 1665 | ||
1666 | private void GenerateMaptileForce() | ||
1667 | { | ||
1668 | // Cannot create a map for a nonexistent heightmap | ||
1669 | if (m_scene.Heightmap == null) | ||
1670 | return; | ||
1671 | |||
1672 | if (m_mapImageGenerator == null) | ||
1673 | { | ||
1674 | Console.WriteLine("No map image generator available for {0}", m_scene.Name); | ||
1675 | return; | ||
1676 | } | ||
1677 | m_log.DebugFormat("[WORLD MAP]: Generating map image for {0}", m_scene.Name); | ||
1678 | |||
1679 | using (Bitmap mapbmp = m_mapImageGenerator.CreateMapTileForce()) | ||
1680 | { | ||
1681 | GenerateMaptile(mapbmp); | ||
1682 | |||
1683 | if (m_mapImageServiceModule != null) | ||
1684 | m_mapImageServiceModule.UploadMapTile(m_scene, mapbmp); | ||
1685 | } | ||
1686 | } | ||
1687 | |||
1664 | public void GenerateMaptile() | 1688 | public void GenerateMaptile() |
1665 | { | 1689 | { |
1666 | // Cannot create a map for a nonexistent heightmap | 1690 | // Cannot create a map for a nonexistent heightmap |
diff --git a/OpenSim/Region/Framework/Interfaces/ITerrain.cs b/OpenSim/Region/Framework/Interfaces/ITerrain.cs index 815a2d8..2fc954a 100644 --- a/OpenSim/Region/Framework/Interfaces/ITerrain.cs +++ b/OpenSim/Region/Framework/Interfaces/ITerrain.cs | |||
@@ -74,6 +74,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
74 | 74 | ||
75 | public interface IMapImageGenerator | 75 | public interface IMapImageGenerator |
76 | { | 76 | { |
77 | System.Drawing.Bitmap CreateMapTileForce(); | ||
77 | System.Drawing.Bitmap CreateMapTile(); | 78 | System.Drawing.Bitmap CreateMapTile(); |
78 | System.Drawing.Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures); | 79 | System.Drawing.Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures); |
79 | byte[] WriteJpeg2000Image(); | 80 | byte[] WriteJpeg2000Image(); |
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 3c7295a..1791098 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -109,17 +109,14 @@ namespace OpenSim.Services.GridService | |||
109 | 109 | ||
110 | m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); | 110 | m_log.Debug("[HYPERGRID LINKER]: Loaded all services..."); |
111 | 111 | ||
112 | if (!string.IsNullOrEmpty(m_MapTileDirectory)) | 112 | try |
113 | { | 113 | { |
114 | try | 114 | Directory.CreateDirectory(m_MapTileDirectory); |
115 | { | 115 | } |
116 | Directory.CreateDirectory(m_MapTileDirectory); | 116 | catch (Exception e) |
117 | } | 117 | { |
118 | catch (Exception e) | 118 | m_log.WarnFormat("[HYPERGRID LINKER]: Could not create map tile storage directory {0}: {1}", m_MapTileDirectory, e); |
119 | { | 119 | m_MapTileDirectory = string.Empty; |
120 | m_log.WarnFormat("[HYPERGRID LINKER]: Could not create map tile storage directory {0}: {1}", m_MapTileDirectory, e); | ||
121 | m_MapTileDirectory = string.Empty; | ||
122 | } | ||
123 | } | 120 | } |
124 | 121 | ||
125 | if (MainConsole.Instance != null) | 122 | if (MainConsole.Instance != null) |