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

@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
{
using (Bitmap bitmap = new Bitmap(filename))
{
ITerrainChannel retval = new TerrainChannel(true);
ITerrainChannel retval = new TerrainChannel(w, h);
for (int x = 0; x < retval.Width; x++)
{

View File

@@ -130,15 +130,14 @@ namespace OpenSim.Region.CoreModules.World.Terrain
{
if (m_scene.Heightmap == null)
{
m_channel = new TerrainChannel(m_InitialTerrain);
m_channel = new TerrainChannel(m_InitialTerrain,
m_scene.RegionInfo.RegionSizeX, m_scene.RegionInfo.RegionSizeY, m_scene.RegionInfo.RegionSizeZ);
m_scene.Heightmap = m_channel;
m_revert = new TerrainChannel();
UpdateRevertMap();
}
else
{
m_channel = m_scene.Heightmap;
m_revert = new TerrainChannel();
UpdateRevertMap();
}
@@ -532,6 +531,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
/// </summary>
public void UpdateRevertMap()
{
/*
int x;
for (x = 0; x < m_channel.Width; x++)
{
@@ -541,6 +541,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
m_revert[x, y] = m_channel[x, y];
}
}
*/
m_revert = m_channel.MakeCopy();
}
/// <summary>