aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-04-27 23:54:16 +0000
committerAdam Frisby2008-04-27 23:54:16 +0000
commit7693a7dac9e6b4c8ed6d4028e210c611ad9d01ce (patch)
tree05e4de1f05ce98a74e85519b6c252b49193519c7 /OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs
parent* Patch from XenReborn to make remove-region work properly without needing to... (diff)
downloadopensim-SC_OLD-7693a7dac9e6b4c8ed6d4028e210c611ad9d01ce.zip
opensim-SC_OLD-7693a7dac9e6b4c8ed6d4028e210c611ad9d01ce.tar.gz
opensim-SC_OLD-7693a7dac9e6b4c8ed6d4028e210c611ad9d01ce.tar.bz2
opensim-SC_OLD-7693a7dac9e6b4c8ed6d4028e210c611ad9d01ce.tar.xz
* Added String(FileExtension) property to ITerrainLoader to allow us to determine which file extension this loader is capable of handling.
* Added ITerrainLoader import capability to Terrain Plugins module - this allows you to write new terrain format plugins without modifying the terrain module directly.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs
index dc8a023..67acef7 100644
--- a/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/Terrain/TerrainModule.cs
@@ -185,7 +185,8 @@ namespace OpenSim.Region.Environment.Modules.Terrain
185 { 185 {
186 m_log.Error( 186 m_log.Error(
187 "[TERRAIN]: Unable to load heightmap, file not found. (A directory permissions error may also cause this)"); 187 "[TERRAIN]: Unable to load heightmap, file not found. (A directory permissions error may also cause this)");
188 throw new TerrainException(String.Format("unable to load heightmap: file {0} not found (or permissions do not allow access", filename)); 188 throw new TerrainException(
189 String.Format("unable to load heightmap: file {0} not found (or permissions do not allow access", filename));
189 } 190 }
190 } 191 }
191 CheckForTerrainUpdates(); 192 CheckForTerrainUpdates();
@@ -244,8 +245,20 @@ namespace OpenSim.Region.Environment.Modules.Terrain
244 if (pluginType.GetInterface("ITerrainEffect", false) != null) 245 if (pluginType.GetInterface("ITerrainEffect", false) != null)
245 { 246 {
246 ITerrainEffect terEffect = (ITerrainEffect) Activator.CreateInstance(library.GetType(pluginType.ToString())); 247 ITerrainEffect terEffect = (ITerrainEffect) Activator.CreateInstance(library.GetType(pluginType.ToString()));
247 m_plugineffects.Add(pluginType.Name, terEffect); 248 if (!m_plugineffects.ContainsKey(pluginType.Name))
248 m_log.Info("... " + pluginType.Name); 249 {
250 m_plugineffects.Add(pluginType.Name, terEffect);
251 m_log.Info("E ... " + pluginType.Name);
252 } else
253 {
254 m_log.Warn("E ... " + pluginType.Name + " (Already added)");
255 }
256 }
257 else if (pluginType.GetInterface("ITerrainLoader", false) != null)
258 {
259 ITerrainLoader terLoader = (ITerrainLoader) Activator.CreateInstance(library.GetType(pluginType.ToString()));
260 m_loaders[terLoader.FileExtension] = terLoader;
261 m_log.Info("L ... " + pluginType.Name);
249 } 262 }
250 } 263 }
251 catch (AmbiguousMatchException) 264 catch (AmbiguousMatchException)