aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs')
-rw-r--r--OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs31
1 files changed, 27 insertions, 4 deletions
diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
index d1d54ad..2bda5ba 100644
--- a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs
@@ -48,6 +48,11 @@ namespace OpenSim.Terrain
48 public class TerrainEngine 48 public class TerrainEngine
49 { 49 {
50 /// <summary> 50 /// <summary>
51 /// Plugin library for scripts
52 /// </summary>
53 public FilterHost customFilters = new FilterHost();
54
55 /// <summary>
51 /// A [normally] 256x256 heightmap 56 /// A [normally] 256x256 heightmap
52 /// </summary> 57 /// </summary>
53 public Channel heightmap; 58 public Channel heightmap;
@@ -193,8 +198,10 @@ namespace OpenSim.Terrain
193 resultText += "terrain erode aerobic <windspeed> <pickupmin> <dropmin> <carry> <rounds> <lowest>\n"; 198 resultText += "terrain erode aerobic <windspeed> <pickupmin> <dropmin> <carry> <rounds> <lowest>\n";
194 resultText += "terrain erode thermal <talus> <rounds> <carry>\n"; 199 resultText += "terrain erode thermal <talus> <rounds> <carry>\n";
195 resultText += "terrain multiply <val> - multiplies a terrain by <val>\n"; 200 resultText += "terrain multiply <val> - multiplies a terrain by <val>\n";
196 resultText += "terrain revert - reverts the terrain to the stored original"; 201 resultText += "terrain revert - reverts the terrain to the stored original\n";
197 resultText += "terrain bake - saves the current terrain into the revert map"; 202 resultText += "terrain bake - saves the current terrain into the revert map\n";
203 resultText += "terrain csfilter <filename.cs> - loads a new filter from the specified .cs file\n";
204 resultText += "terrain jsfilter <filename.js> - loads a new filter from the specified .js file\n";
198 return false; 205 return false;
199 206
200 case "revert": 207 case "revert":
@@ -285,9 +292,25 @@ namespace OpenSim.Terrain
285 } 292 }
286 break; 293 break;
287 294
295 case "csfilter":
296 customFilters.LoadFilterCSharp(args[1]);
297 break;
298 case "jsfilter":
299 customFilters.LoadFilterJScript(args[1]);
300 break;
301
288 default: 302 default:
289 resultText = "Unknown terrain command"; 303 // Run any custom registered filters
290 return false; 304 if (customFilters.filters.ContainsKey(command))
305 {
306 customFilters.filters[command].Filter(heightmap, args);
307 break;
308 }
309 else
310 {
311 resultText = "Unknown terrain command";
312 return false;
313 }
291 } 314 }
292 return true; 315 return true;
293 } 316 }