From 24a093035b5dba3754ec92128a18a9ae5a01b243 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 23 Aug 2015 01:42:51 +0100 Subject: more fixes on map --- .../ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | 5 +++-- .../Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs | 10 +++++++--- OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index 8484809..3ed756a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs @@ -144,9 +144,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage lock (m_scenes) m_scenes[scene.RegionInfo.RegionID] = scene; + // v2 Map generation on startup is now handled by scene to allow bmp to be shared with + // v1 service and not generate map tiles twice as was previous behavior + //scene.EventManager.OnRegionReadyStatusChange += s => { if (s.Ready) UploadMapTile(s); }; scene.RegisterModuleInterface(this); - - scene.EventManager.OnRegionReadyStatusChange += s => { if (s.Ready) UploadMapTile(s); }; } /// diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs index 17066bd..f538c9e 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs @@ -125,10 +125,12 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap public Bitmap CreateMapTile() { + /* this must be on all map, not just its image if ((DateTime.Now - lastImageTime).TotalSeconds < 3600) { - return lastImage.Clone(new Rectangle(0, 0, 256, 256), lastImage.PixelFormat); + return (Bitmap)lastImage.Clone(); } + */ List renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); if (renderers.Count > 0) @@ -147,10 +149,12 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap Bitmap tile = CreateMapTile(viewport, false); m_primMesher = null; - + return tile; +/* lastImage = tile; lastImageTime = DateTime.Now; - return lastImage.Clone(new Rectangle(0, 0, 256, 256), lastImage.PixelFormat); + return (Bitmap)lastImage.Clone(); + */ } public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures) diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 9a6ee99..1ebde68 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -1408,7 +1408,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap using (Bitmap mapbmp = m_mapImageGenerator.CreateMapTile()) { GenerateMaptile(mapbmp); -// m_mapImageServiceModule.UploadMapTile(m_scene, mapbmp); + m_mapImageServiceModule.UploadMapTile(m_scene, mapbmp); } } -- cgit v1.1