Convert the map image modules to new style modules

viewer-2-initial-appearance
Melanie 2010-10-06 01:42:18 +01:00
parent 613bdb40bd
commit c97398575c
3 changed files with 42 additions and 12 deletions

View File

@ -76,6 +76,8 @@
<RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \ <RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \
<RegionModule id="AuthenticationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication.AuthenticationServiceInConnectorModule" /> <RegionModule id="AuthenticationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Authentication.AuthenticationServiceInConnectorModule" />
<RegionModule id="AccessModule" type="OpenSim.Region.CoreModules.World.AccessModule" /> \ <RegionModule id="AccessModule" type="OpenSim.Region.CoreModules.World.AccessModule" /> \
<RegionModule id="MapImageModule" type="OpenSim.Region.CoreModules.World.LegacyMap.MapImageModule" /> \
<RegionModule id="Warp3DImageModule" type="OpenSim.Region.CoreModules.World.Warp3DMap/Warp3DImageModule" /> \
</Extension> </Extension>

View File

@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
public face[] trns; public face[] trns;
} }
public class MapImageModule : IMapImageGenerator, IRegionModule public class MapImageModule : IMapImageGenerator, INonSharedRegionModule
{ {
private static readonly ILog m_log = private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -67,6 +67,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
private Scene m_scene; private Scene m_scene;
private IConfigSource m_config; private IConfigSource m_config;
private IMapTileTerrainRenderer terrainRenderer; private IMapTileTerrainRenderer terrainRenderer;
private bool m_Enabled = false;
#region IMapImageGenerator Members #region IMapImageGenerator Members
@ -132,9 +133,8 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
#region IRegionModule Members #region IRegionModule Members
public void Initialise(Scene scene, IConfigSource source) public void Initialise(IConfigSource source)
{ {
m_scene = scene;
m_config = source; m_config = source;
IConfig startupConfig = m_config.Configs["Startup"]; IConfig startupConfig = m_config.Configs["Startup"];
@ -142,10 +142,24 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
"MapImageModule") "MapImageModule")
return; return;
m_Enabled = true;
}
public void AddRegion(Scene scene)
{
if (!m_Enabled)
return;
m_scene = scene;
m_scene.RegisterModuleInterface<IMapImageGenerator>(this); m_scene.RegisterModuleInterface<IMapImageGenerator>(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"; } get { return "MapImageModule"; }
} }
public bool IsSharedModule public Type ReplaceableInterface
{ {
get { return false; } get { return null; }
} }
#endregion #endregion

View File

@ -49,7 +49,7 @@ using WarpRenderer = global::Warp3D.Warp3D;
namespace OpenSim.Region.CoreModules.World.Warp3DMap 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 UUID TEXTURE_METADATA_MAGIC = new UUID("802dc0e0-f080-4931-8b57-d1be8611c4f3");
private static readonly Color4 WATER_COLOR = new Color4(29, 71, 95, 216); 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 IConfigSource m_config;
private Dictionary<UUID, Color4> m_colors = new Dictionary<UUID, Color4>(); private Dictionary<UUID, Color4> m_colors = new Dictionary<UUID, Color4>();
private bool m_useAntiAliasing = true; // TODO: Make this a config option private bool m_useAntiAliasing = true; // TODO: Make this a config option
private bool m_Enabled = false;
#region IRegionModule Members #region IRegionModule Members
public void Initialise(Scene scene, IConfigSource source) public void Initialise(IConfigSource source)
{ {
m_scene = scene;
m_config = source; m_config = source;
IConfig startupConfig = m_config.Configs["Startup"]; IConfig startupConfig = m_config.Configs["Startup"];
if (startupConfig.GetString("MapImageModule", "MapImageModule") != "Warp3DImageModule") if (startupConfig.GetString("MapImageModule", "MapImageModule") != "Warp3DImageModule")
return; return;
m_Enabled = true;
}
public void AddRegion(Scene scene)
{
if (!m_Enabled)
return;
m_scene = scene;
List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory());
if (renderers.Count > 0) if (renderers.Count > 0)
{ {
@ -88,7 +98,11 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
m_scene.RegisterModuleInterface<IMapImageGenerator>(this); m_scene.RegisterModuleInterface<IMapImageGenerator>(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"; } get { return "Warp3DImageModule"; }
} }
public bool IsSharedModule public Type ReplaceableInterface
{ {
get { return false; } get { return null; }
} }
#endregion #endregion