* 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.Sugilite
parent
b4bb74653c
commit
4301d0f075
|
@ -149,6 +149,24 @@ namespace OpenSim.Terrain
|
|||
tainted++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Swaps the two heightmap buffers (the 'revert map' and the heightmap)
|
||||
/// </summary>
|
||||
public void swapRevertMaps()
|
||||
{
|
||||
Channel backup = heightmap.copy();
|
||||
heightmap = revertmap;
|
||||
revertmap = backup;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves the current heightmap into the revertmap
|
||||
/// </summary>
|
||||
public void saveRevertMap()
|
||||
{
|
||||
revertmap = heightmap.copy();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes a terrain-specific command
|
||||
/// </summary>
|
||||
|
@ -175,8 +193,19 @@ namespace OpenSim.Terrain
|
|||
resultText += "terrain erode aerobic <windspeed> <pickupmin> <dropmin> <carry> <rounds> <lowest>\n";
|
||||
resultText += "terrain erode thermal <talus> <rounds> <carry>\n";
|
||||
resultText += "terrain multiply <val> - multiplies a terrain by <val>\n";
|
||||
resultText += "terrain revert - reverts the terrain to the stored original";
|
||||
resultText += "terrain bake - saves the current terrain into the revert map";
|
||||
return false;
|
||||
|
||||
case "revert":
|
||||
swapRevertMaps();
|
||||
saveRevertMap();
|
||||
break;
|
||||
|
||||
case "bake":
|
||||
saveRevertMap();
|
||||
break;
|
||||
|
||||
case "seed":
|
||||
setSeed(Convert.ToInt32(args[1]));
|
||||
break;
|
||||
|
@ -222,7 +251,7 @@ namespace OpenSim.Terrain
|
|||
break;
|
||||
|
||||
case "img":
|
||||
resultText = "Error - IMG mode is presently unsupported.";
|
||||
heightmap.loadImage(args[2]);
|
||||
return false;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue