* Renamed a number of TerrainEngine functions to conform naming standards better.
parent
f22b8b6f04
commit
7d61705c3c
|
@ -685,7 +685,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
private void UpdateTerrain()
|
||||
{
|
||||
if (Terrain.Tainted() && !Terrain.StillEditing())
|
||||
if (Terrain.IsTainted() && !Terrain.IsUserStillEditing())
|
||||
{
|
||||
CreateTerrainTexture(true);
|
||||
|
||||
|
@ -706,7 +706,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
for (int y = 0; y < 16; y++)
|
||||
{
|
||||
if (Terrain.Tainted(x*16, y*16))
|
||||
if (Terrain.IsTainted(x*16, y*16))
|
||||
{
|
||||
client.SendLayerData(x, y, terData);
|
||||
}
|
||||
|
@ -807,6 +807,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
public void LoadWorldMap(string filename)
|
||||
{
|
||||
Terrain.LoadFromFileF32(filename);
|
||||
Terrain.SaveRevertMap();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -823,7 +824,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
if (string.IsNullOrEmpty(m_regInfo.EstateSettings.terrainFile))
|
||||
{
|
||||
MainLog.Instance.Verbose("TERRAIN", "No default terrain. Generating a new terrain.");
|
||||
Terrain.HillsGenerator();
|
||||
Terrain.SetDefaultTerrain();
|
||||
|
||||
m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
|
||||
}
|
||||
|
@ -838,7 +839,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
MainLog.Instance.Verbose("TERRAIN",
|
||||
"No terrain found in database or default. Generating a new terrain.");
|
||||
Terrain.HillsGenerator();
|
||||
Terrain.SetDefaultTerrain();
|
||||
}
|
||||
m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
|
||||
}
|
||||
|
@ -885,7 +886,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
public void CreateTerrainTexture(bool temporary)
|
||||
{
|
||||
//create a texture asset of the terrain
|
||||
byte[] data = Terrain.ExportJpegImage("defaultstripe.png");
|
||||
byte[] data = Terrain.WriteJpegImage("defaultstripe.png");
|
||||
m_regInfo.EstateSettings.terrainImageID = LLUUID.Random();
|
||||
AssetBase asset = new AssetBase();
|
||||
asset.FullID = m_regInfo.EstateSettings.terrainImageID;
|
||||
|
|
|
@ -123,12 +123,12 @@ namespace OpenSim.Region.Terrain
|
|||
tainted++;
|
||||
}
|
||||
|
||||
public bool Tainted()
|
||||
public bool IsTainted()
|
||||
{
|
||||
return (tainted != 0);
|
||||
}
|
||||
|
||||
public bool StillEditing()
|
||||
public bool IsUserStillEditing()
|
||||
{
|
||||
TimeSpan gap = DateTime.Now - lastEdit;
|
||||
|
||||
|
@ -138,7 +138,7 @@ namespace OpenSim.Region.Terrain
|
|||
return false;
|
||||
}
|
||||
|
||||
public bool Tainted(int x, int y)
|
||||
public bool IsTainted(int x, int y)
|
||||
{
|
||||
return (heightmap.diff[x/16, y/16] != 0);
|
||||
}
|
||||
|
@ -284,7 +284,7 @@ namespace OpenSim.Region.Terrain
|
|||
{
|
||||
for (int y = 0; y < 16; y++)
|
||||
{
|
||||
if (Tainted(x*16, y*16))
|
||||
if (IsTainted(x*16, y*16))
|
||||
{
|
||||
remoteUser.SendLayerData(x, y, GetHeights1D());
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ namespace OpenSim.Region.Terrain
|
|||
/// <summary>
|
||||
/// Checks to make sure the terrain is within baked values +/- maxRaise/minLower
|
||||
/// </summary>
|
||||
public void CheckHeightValues()
|
||||
private void SetTerrainWithinBounds()
|
||||
{
|
||||
int x, y;
|
||||
for (x = 0; x < w; x++)
|
||||
|
@ -518,7 +518,7 @@ namespace OpenSim.Region.Terrain
|
|||
return ConsoleHills(args, ref resultText);
|
||||
|
||||
case "regenerate":
|
||||
HillsGenerator();
|
||||
SetDefaultTerrain();
|
||||
break;
|
||||
|
||||
case "rescale":
|
||||
|
@ -618,9 +618,9 @@ namespace OpenSim.Region.Terrain
|
|||
|
||||
case "grdmap":
|
||||
if (args.Length >= 4)
|
||||
ExportImage(filename, args[3]);
|
||||
WriteImage(filename, args[3]);
|
||||
else
|
||||
ExportImage(filename, "defaultstripe.png");
|
||||
WriteImage(filename, "defaultstripe.png");
|
||||
break;
|
||||
|
||||
case "png":
|
||||
|
@ -1272,7 +1272,7 @@ namespace OpenSim.Region.Terrain
|
|||
/// <summary>
|
||||
/// Generates a simple set of hills in the shape of an island
|
||||
/// </summary>
|
||||
public void HillsGenerator()
|
||||
public void SetDefaultTerrain()
|
||||
{
|
||||
lock (heightmap)
|
||||
{
|
||||
|
@ -1317,7 +1317,7 @@ namespace OpenSim.Region.Terrain
|
|||
/// </summary>
|
||||
/// <param name="filename">The destination filename for the image</param>
|
||||
/// <param name="gradientmap">A 1x*height* image which contains the colour gradient to export with. Must be at least 1x2 pixels, 1x256 or more is ideal.</param>
|
||||
public void ExportImage(string filename, string gradientmap)
|
||||
public void WriteImage(string filename, string gradientmap)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1335,7 +1335,7 @@ namespace OpenSim.Region.Terrain
|
|||
/// Exports the current heightmap in Jpeg2000 format to a byte[]
|
||||
/// </summary>
|
||||
/// <param name="gradientmap">A 1x*height* image which contains the colour gradient to export with. Must be at least 1x2 pixels, 1x256 or more is ideal.</param>
|
||||
public byte[] ExportJpegImage(string gradientmap)
|
||||
public byte[] WriteJpegImage(string gradientmap)
|
||||
{
|
||||
byte[] imageData = null;
|
||||
try
|
||||
|
|
Loading…
Reference in New Issue