varregion: serious rework of TerrainChannel:

-- addition of varaible region size in X and Y
    -- internal storage of heightmap changed from double[] to short[]
    -- helper routines for handling internal structure while keeping existing API
    -- to and from XML that adds region size information (for downward compatibility,
        output in the legacy XML format if X and Y are 256)
Updated and commented Constants.RegionSize but didn't change the name for compatibility.
This commit is contained in:
Robert Adams
2013-09-25 17:21:20 -07:00
parent aea5d3a842
commit 8c1d80fdfd
9 changed files with 255 additions and 143 deletions

View File

@@ -29,15 +29,21 @@ namespace OpenSim.Region.Framework.Interfaces
{
public interface ITerrainChannel
{
int Height { get; }
int Width { get;} // X dimension
int Height { get;} // Y dimension
int Altitude { get;} // Z dimension
double this[int x, int y] { get; set; }
int Width { get; }
/// <summary>
/// Squash the entire heightmap into a single dimensioned array
/// </summary>
/// <returns></returns>
float[] GetFloatsSerialised();
// Get version of map as a single dimensioned array and each value compressed
// into an int (compressedHeight = (int)(floatHeight * Constants.TerrainCompression);)
// This is done to make the map smaller as it can get pretty larger for variable sized regions.
short[] GetCompressedMap();
double[,] GetDoubles();
bool Tainted(int x, int y);