diff options
author | Adam Frisby | 2007-06-20 21:24:00 +0000 |
---|---|---|
committer | Adam Frisby | 2007-06-20 21:24:00 +0000 |
commit | 4301d0f0755c294d5f226629727d33c0ea30eea8 (patch) | |
tree | 898230f1857b5a4ded990dd56f8f8b205c365f93 /OpenSim | |
parent | * Adding a bunch of region xml files. (diff) | |
download | opensim-SC_OLD-4301d0f0755c294d5f226629727d33c0ea30eea8.zip opensim-SC_OLD-4301d0f0755c294d5f226629727d33c0ea30eea8.tar.gz opensim-SC_OLD-4301d0f0755c294d5f226629727d33c0ea30eea8.tar.bz2 opensim-SC_OLD-4301d0f0755c294d5f226629727d33c0ea30eea8.tar.xz |
* Added support for "revert" and "bake" commands on terrain console
* Implemented "IMG" load method for "terrain load" - supports PNG, BMP, TIFF, TGA and probably a handful of other formats.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs index c78af05..9cd8099 100644 --- a/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim/OpenSim.Terrain.BasicTerrain/TerrainEngine.cs | |||
@@ -150,6 +150,24 @@ namespace OpenSim.Terrain | |||
150 | } | 150 | } |
151 | 151 | ||
152 | /// <summary> | 152 | /// <summary> |
153 | /// Swaps the two heightmap buffers (the 'revert map' and the heightmap) | ||
154 | /// </summary> | ||
155 | public void swapRevertMaps() | ||
156 | { | ||
157 | Channel backup = heightmap.copy(); | ||
158 | heightmap = revertmap; | ||
159 | revertmap = backup; | ||
160 | } | ||
161 | |||
162 | /// <summary> | ||
163 | /// Saves the current heightmap into the revertmap | ||
164 | /// </summary> | ||
165 | public void saveRevertMap() | ||
166 | { | ||
167 | revertmap = heightmap.copy(); | ||
168 | } | ||
169 | |||
170 | /// <summary> | ||
153 | /// Processes a terrain-specific command | 171 | /// Processes a terrain-specific command |
154 | /// </summary> | 172 | /// </summary> |
155 | /// <param name="args">Commandline arguments (space seperated)</param> | 173 | /// <param name="args">Commandline arguments (space seperated)</param> |
@@ -175,8 +193,19 @@ namespace OpenSim.Terrain | |||
175 | resultText += "terrain erode aerobic <windspeed> <pickupmin> <dropmin> <carry> <rounds> <lowest>\n"; | 193 | resultText += "terrain erode aerobic <windspeed> <pickupmin> <dropmin> <carry> <rounds> <lowest>\n"; |
176 | resultText += "terrain erode thermal <talus> <rounds> <carry>\n"; | 194 | resultText += "terrain erode thermal <talus> <rounds> <carry>\n"; |
177 | resultText += "terrain multiply <val> - multiplies a terrain by <val>\n"; | 195 | resultText += "terrain multiply <val> - multiplies a terrain by <val>\n"; |
196 | resultText += "terrain revert - reverts the terrain to the stored original"; | ||
197 | resultText += "terrain bake - saves the current terrain into the revert map"; | ||
178 | return false; | 198 | return false; |
179 | 199 | ||
200 | case "revert": | ||
201 | swapRevertMaps(); | ||
202 | saveRevertMap(); | ||
203 | break; | ||
204 | |||
205 | case "bake": | ||
206 | saveRevertMap(); | ||
207 | break; | ||
208 | |||
180 | case "seed": | 209 | case "seed": |
181 | setSeed(Convert.ToInt32(args[1])); | 210 | setSeed(Convert.ToInt32(args[1])); |
182 | break; | 211 | break; |
@@ -222,7 +251,7 @@ namespace OpenSim.Terrain | |||
222 | break; | 251 | break; |
223 | 252 | ||
224 | case "img": | 253 | case "img": |
225 | resultText = "Error - IMG mode is presently unsupported."; | 254 | heightmap.loadImage(args[2]); |
226 | return false; | 255 | return false; |
227 | 256 | ||
228 | default: | 257 | default: |