mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
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:
@@ -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++)
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user