diff options
author | Dev Random | 2015-05-07 13:25:36 -0400 |
---|---|---|
committer | Michael Cerquoni | 2015-05-07 14:07:50 -0400 |
commit | a9dd3028b94b35fb9c504b05466522cd2f9be306 (patch) | |
tree | f9fa49f5887654feec670d1633b265d8a0866c56 /OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |
parent | 'terrain modify' command for area-of-effect operations (diff) | |
download | opensim-SC_OLD-a9dd3028b94b35fb9c504b05466522cd2f9be306.zip opensim-SC_OLD-a9dd3028b94b35fb9c504b05466522cd2f9be306.tar.gz opensim-SC_OLD-a9dd3028b94b35fb9c504b05466522cd2f9be306.tar.bz2 opensim-SC_OLD-a9dd3028b94b35fb9c504b05466522cd2f9be306.tar.xz |
Add 'terrain modify noise' and code cleanup
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 02f21b9..05c5fca 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -41,7 +41,6 @@ using OpenSim.Framework; | |||
41 | using OpenSim.Framework.Console; | 41 | using OpenSim.Framework.Console; |
42 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; | 42 | using OpenSim.Region.CoreModules.Framework.InterfaceCommander; |
43 | using OpenSim.Region.CoreModules.World.Terrain.FileLoaders; | 43 | using OpenSim.Region.CoreModules.World.Terrain.FileLoaders; |
44 | using OpenSim.Region.CoreModules.World.Terrain.Features; | ||
45 | using OpenSim.Region.CoreModules.World.Terrain.Modifiers; | 44 | using OpenSim.Region.CoreModules.World.Terrain.Modifiers; |
46 | using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes; | 45 | using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes; |
47 | using OpenSim.Region.CoreModules.World.Terrain.PaintBrushes; | 46 | using OpenSim.Region.CoreModules.World.Terrain.PaintBrushes; |
@@ -75,14 +74,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
75 | 74 | ||
76 | #endregion | 75 | #endregion |
77 | 76 | ||
78 | /// <summary> | ||
79 | /// Terrain Features | ||
80 | /// </summary> | ||
81 | public enum TerrainFeatures: byte | ||
82 | { | ||
83 | Rectangle = 1, | ||
84 | } | ||
85 | |||
86 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 77 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
87 | 78 | ||
88 | #pragma warning disable 414 | 79 | #pragma warning disable 414 |
@@ -96,8 +87,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
96 | private readonly Dictionary<StandardTerrainEffects, ITerrainPaintableEffect> m_painteffects = | 87 | private readonly Dictionary<StandardTerrainEffects, ITerrainPaintableEffect> m_painteffects = |
97 | new Dictionary<StandardTerrainEffects, ITerrainPaintableEffect>(); | 88 | new Dictionary<StandardTerrainEffects, ITerrainPaintableEffect>(); |
98 | private Dictionary<string, ITerrainEffect> m_plugineffects; | 89 | private Dictionary<string, ITerrainEffect> m_plugineffects; |
99 | private Dictionary<string, ITerrainFeature> m_featureEffects = | ||
100 | new Dictionary<string, ITerrainFeature>(); | ||
101 | private Dictionary<string, ITerrainModifier> m_modifyOperations = | 90 | private Dictionary<string, ITerrainModifier> m_modifyOperations = |
102 | new Dictionary<string, ITerrainModifier>(); | 91 | new Dictionary<string, ITerrainModifier>(); |
103 | private ITerrainChannel m_channel; | 92 | private ITerrainChannel m_channel; |
@@ -657,9 +646,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
657 | m_floodeffects[StandardTerrainEffects.Flatten] = new FlattenArea(); | 646 | m_floodeffects[StandardTerrainEffects.Flatten] = new FlattenArea(); |
658 | m_floodeffects[StandardTerrainEffects.Revert] = new RevertArea(m_revert); | 647 | m_floodeffects[StandardTerrainEffects.Revert] = new RevertArea(m_revert); |
659 | 648 | ||
660 | // Terrain Feature effects | ||
661 | m_featureEffects["rectangle"] = new RectangleFeature(this); | ||
662 | |||
663 | // Terrain Modifier operations | 649 | // Terrain Modifier operations |
664 | m_modifyOperations["min"] = new MinModifier(this); | 650 | m_modifyOperations["min"] = new MinModifier(this); |
665 | m_modifyOperations["max"] = new MaxModifier(this); | 651 | m_modifyOperations["max"] = new MaxModifier(this); |
@@ -667,6 +653,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
667 | m_modifyOperations["lower"] = new LowerModifier(this); | 653 | m_modifyOperations["lower"] = new LowerModifier(this); |
668 | m_modifyOperations["fill"] = new FillModifier(this); | 654 | m_modifyOperations["fill"] = new FillModifier(this); |
669 | m_modifyOperations["smooth"] = new SmoothModifier(this); | 655 | m_modifyOperations["smooth"] = new SmoothModifier(this); |
656 | m_modifyOperations["noise"] = new NoiseModifier(this); | ||
670 | 657 | ||
671 | // Filesystem load/save loaders | 658 | // Filesystem load/save loaders |
672 | m_loaders[".r32"] = new RAW32(); | 659 | m_loaders[".r32"] = new RAW32(); |
@@ -1671,9 +1658,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1671 | // Add this to our scene so scripts can call these functions | 1658 | // Add this to our scene so scripts can call these functions |
1672 | m_scene.RegisterModuleCommander(m_commander); | 1659 | m_scene.RegisterModuleCommander(m_commander); |
1673 | 1660 | ||
1674 | // Add Feature command to Scene, since Command object requires fixed-length arglists | ||
1675 | m_scene.AddCommand("Terrain", this, "terrain feature", | ||
1676 | "terrain feature <type> <parameters...>", "Constructs a feature of the requested type.", FeatureCommand); | ||
1677 | // Add Modify command to Scene, since Command object requires fixed-length arglists | 1661 | // Add Modify command to Scene, since Command object requires fixed-length arglists |
1678 | m_scene.AddCommand("Terrain", this, "terrain modify", | 1662 | m_scene.AddCommand("Terrain", this, "terrain modify", |
1679 | "terrain modify <operation> <value> [<area>] [<taper>]", | 1663 | "terrain modify <operation> <value> [<area>] [<taper>]", |
@@ -1689,40 +1673,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1689 | 1673 | ||
1690 | } | 1674 | } |
1691 | 1675 | ||
1692 | public void FeatureCommand(string module, string[] cmd) | ||
1693 | { | ||
1694 | string result; | ||
1695 | if (cmd.Length > 2) | ||
1696 | { | ||
1697 | string featureType = cmd[2]; | ||
1698 | |||
1699 | ITerrainFeature feature; | ||
1700 | if (!m_featureEffects.TryGetValue(featureType, out feature)) | ||
1701 | { | ||
1702 | result = String.Format("Terrain Feature \"{0}\" not found.", featureType); | ||
1703 | } | ||
1704 | else if ((cmd.Length > 3) && (cmd[3] == "usage")) | ||
1705 | { | ||
1706 | result = "Usage: " + feature.GetUsage(); | ||
1707 | } | ||
1708 | else | ||
1709 | { | ||
1710 | result = feature.CreateFeature(m_channel, cmd); | ||
1711 | } | ||
1712 | |||
1713 | if (result == String.Empty) | ||
1714 | { | ||
1715 | result = "Created Feature"; | ||
1716 | m_log.DebugFormat("Created terrain feature {0}", featureType); | ||
1717 | } | ||
1718 | } | ||
1719 | else | ||
1720 | { | ||
1721 | result = "Usage: <feature-name> <arg1> <arg2>..."; | ||
1722 | } | ||
1723 | MainConsole.Instance.Output(result); | ||
1724 | } | ||
1725 | |||
1726 | public void ModifyCommand(string module, string[] cmd) | 1676 | public void ModifyCommand(string module, string[] cmd) |
1727 | { | 1677 | { |
1728 | string result; | 1678 | string result; |