From c97398575cf576d214edcc15636c45e4dc287b52 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 6 Oct 2010 01:42:18 +0100
Subject: Convert the map image modules to new style modules
---
.../Resources/CoreModulePlugin.addin.xml | 2 ++
.../CoreModules/World/LegacyMap/MapImageModule.cs | 26 +++++++++++++++++-----
.../CoreModules/World/Warp3DMap/MapImageModule.cs | 26 +++++++++++++++++-----
3 files changed, 42 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region/CoreModules')
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
index e85e4e9..730ee25 100644
--- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
+++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
@@ -76,6 +76,8 @@
\
\
+ \
+ \
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
index 8408bf9..c9ef1f4 100644
--- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
public face[] trns;
}
- public class MapImageModule : IMapImageGenerator, IRegionModule
+ public class MapImageModule : IMapImageGenerator, INonSharedRegionModule
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -67,6 +67,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
private Scene m_scene;
private IConfigSource m_config;
private IMapTileTerrainRenderer terrainRenderer;
+ private bool m_Enabled = false;
#region IMapImageGenerator Members
@@ -132,9 +133,8 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
#region IRegionModule Members
- public void Initialise(Scene scene, IConfigSource source)
+ public void Initialise(IConfigSource source)
{
- m_scene = scene;
m_config = source;
IConfig startupConfig = m_config.Configs["Startup"];
@@ -142,10 +142,24 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
"MapImageModule")
return;
+ m_Enabled = true;
+ }
+
+ public void AddRegion(Scene scene)
+ {
+ if (!m_Enabled)
+ return;
+
+ m_scene = scene;
+
m_scene.RegisterModuleInterface(this);
}
- public void PostInitialise()
+ public void RegionLoaded(Scene scene)
+ {
+ }
+
+ public void RemoveRegion(Scene scene)
{
}
@@ -158,9 +172,9 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
get { return "MapImageModule"; }
}
- public bool IsSharedModule
+ public Type ReplaceableInterface
{
- get { return false; }
+ get { return null; }
}
#endregion
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
index 803a33a..eca85d3 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs
@@ -49,7 +49,7 @@ using WarpRenderer = global::Warp3D.Warp3D;
namespace OpenSim.Region.CoreModules.World.Warp3DMap
{
- public class Warp3DImageModule : IMapImageGenerator, IRegionModule
+ public class Warp3DImageModule : IMapImageGenerator, INonSharedRegionModule
{
private static readonly UUID TEXTURE_METADATA_MAGIC = new UUID("802dc0e0-f080-4931-8b57-d1be8611c4f3");
private static readonly Color4 WATER_COLOR = new Color4(29, 71, 95, 216);
@@ -62,18 +62,28 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
private IConfigSource m_config;
private Dictionary m_colors = new Dictionary();
private bool m_useAntiAliasing = true; // TODO: Make this a config option
+ private bool m_Enabled = false;
#region IRegionModule Members
- public void Initialise(Scene scene, IConfigSource source)
+ public void Initialise(IConfigSource source)
{
- m_scene = scene;
m_config = source;
IConfig startupConfig = m_config.Configs["Startup"];
if (startupConfig.GetString("MapImageModule", "MapImageModule") != "Warp3DImageModule")
return;
+ m_Enabled = true;
+ }
+
+ public void AddRegion(Scene scene)
+ {
+ if (!m_Enabled)
+ return;
+
+ m_scene = scene;
+
List renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory());
if (renderers.Count > 0)
{
@@ -88,7 +98,11 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
m_scene.RegisterModuleInterface(this);
}
- public void PostInitialise()
+ public void RegionLoaded(Scene scene)
+ {
+ }
+
+ public void RemoveRegion(Scene scene)
{
}
@@ -101,9 +115,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
get { return "Warp3DImageModule"; }
}
- public bool IsSharedModule
+ public Type ReplaceableInterface
{
- get { return false; }
+ get { return null; }
}
#endregion
--
cgit v1.1