diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 2eac0fa..3f848ed 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -1108,6 +1108,32 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1108 | CheckForTerrainUpdates(); | 1108 | CheckForTerrainUpdates(); |
1109 | } | 1109 | } |
1110 | 1110 | ||
1111 | private void InterfaceMinTerrain(Object[] args) | ||
1112 | { | ||
1113 | int x, y; | ||
1114 | for (x = 0; x < m_channel.Width; x++) | ||
1115 | { | ||
1116 | for (y = 0; y < m_channel.Height; y++) | ||
1117 | { | ||
1118 | m_channel[x, y] = Math.Max((double)args[0], m_channel[x, y]); | ||
1119 | } | ||
1120 | } | ||
1121 | CheckForTerrainUpdates(); | ||
1122 | } | ||
1123 | |||
1124 | private void InterfaceMaxTerrain(Object[] args) | ||
1125 | { | ||
1126 | int x, y; | ||
1127 | for (x = 0; x < m_channel.Width; x++) | ||
1128 | { | ||
1129 | for (y = 0; y < m_channel.Height; y++) | ||
1130 | { | ||
1131 | m_channel[x, y] = Math.Min((double)args[0], m_channel[x, y]); | ||
1132 | } | ||
1133 | } | ||
1134 | CheckForTerrainUpdates(); | ||
1135 | } | ||
1136 | |||
1111 | private void InterfaceShowDebugStats(Object[] args) | 1137 | private void InterfaceShowDebugStats(Object[] args) |
1112 | { | 1138 | { |
1113 | double max = Double.MinValue; | 1139 | double max = Double.MinValue; |
@@ -1248,6 +1274,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1248 | rescaleCommand.AddArgument("min", "min terrain height after rescaling", "Double"); | 1274 | rescaleCommand.AddArgument("min", "min terrain height after rescaling", "Double"); |
1249 | rescaleCommand.AddArgument("max", "max terrain height after rescaling", "Double"); | 1275 | rescaleCommand.AddArgument("max", "max terrain height after rescaling", "Double"); |
1250 | 1276 | ||
1277 | Command minCommand = new Command("min", CommandIntentions.COMMAND_HAZARDOUS, InterfaceMinTerrain, "Sets the minimum terrain height to the specified value."); | ||
1278 | minCommand.AddArgument("min", "terrain height to use as minimum", "Double"); | ||
1279 | |||
1280 | Command maxCommand = new Command("max", CommandIntentions.COMMAND_HAZARDOUS, InterfaceMaxTerrain, "Sets the maximum terrain height to the specified value."); | ||
1281 | maxCommand.AddArgument("min", "terrain height to use as maximum", "Double"); | ||
1282 | |||
1251 | 1283 | ||
1252 | // Debug | 1284 | // Debug |
1253 | Command showDebugStatsCommand = | 1285 | Command showDebugStatsCommand = |
@@ -1279,6 +1311,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1279 | m_commander.RegisterCommand("effect", pluginRunCommand); | 1311 | m_commander.RegisterCommand("effect", pluginRunCommand); |
1280 | m_commander.RegisterCommand("flip", flipCommand); | 1312 | m_commander.RegisterCommand("flip", flipCommand); |
1281 | m_commander.RegisterCommand("rescale", rescaleCommand); | 1313 | m_commander.RegisterCommand("rescale", rescaleCommand); |
1314 | m_commander.RegisterCommand("min", minCommand); | ||
1315 | m_commander.RegisterCommand("max", maxCommand); | ||
1282 | 1316 | ||
1283 | // Add this to our scene so scripts can call these functions | 1317 | // Add this to our scene so scripts can call these functions |
1284 | m_scene.RegisterModuleCommander(m_commander); | 1318 | m_scene.RegisterModuleCommander(m_commander); |