From 7d61705c3c669cea77536f6bad4383790277c167 Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Tue, 22 Jan 2008 00:33:05 +0000
Subject: * Renamed a number of TerrainEngine functions to conform naming
standards better.
---
OpenSim/Region/Environment/Scenes/Scene.cs | 11 ++++++-----
.../Region/Terrain.BasicTerrain/TerrainEngine.cs | 22 +++++++++++-----------
2 files changed, 17 insertions(+), 16 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 7175d83..64b9abb 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -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();
}
///
@@ -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;
diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
index fdbbb5e..7605122 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs
@@ -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
///
/// Checks to make sure the terrain is within baked values +/- maxRaise/minLower
///
- 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
///
/// Generates a simple set of hills in the shape of an island
///
- public void HillsGenerator()
+ public void SetDefaultTerrain()
{
lock (heightmap)
{
@@ -1317,7 +1317,7 @@ namespace OpenSim.Region.Terrain
///
/// The destination filename for the image
/// A 1x*height* image which contains the colour gradient to export with. Must be at least 1x2 pixels, 1x256 or more is ideal.
- 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[]
///
/// A 1x*height* image which contains the colour gradient to export with. Must be at least 1x2 pixels, 1x256 or more is ideal.
- public byte[] ExportJpegImage(string gradientmap)
+ public byte[] WriteJpegImage(string gradientmap)
{
byte[] imageData = null;
try
--
cgit v1.1