varregion: move the compressed heighmap compression factor from

Constants into TerrainData.
Save compression factor with the terrain blob in the database.
This commit is contained in:
Robert Adams
2013-10-16 07:52:30 -07:00
parent 86bf79aa2b
commit 97bc5263de
5 changed files with 42 additions and 37 deletions

View File

@@ -74,6 +74,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
#endregion
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly string LogHeader = "[TERRAIN MODULE]";
private readonly Commander m_commander = new Commander("terrain");
@@ -712,7 +713,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
private void CheckForTerrainUpdates(bool respectEstateSettings)
{
bool shouldTaint = false;
float[] terrData = m_channel.GetFloatsSerialised();
float[] terrHeights = m_channel.GetFloatsSerialised();
int x;
for (x = 0; x < m_channel.Width; x += Constants.TerrainPatchSize)
{
@@ -727,10 +728,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain
if (respectEstateSettings && LimitChannelChanges(x, y))
{
// Terrain heights were modified. Refetch the terrain info.
terrData = m_channel.GetFloatsSerialised();
terrHeights = m_channel.GetFloatsSerialised();
}
SendToClients(terrData, x, y);
// m_log.DebugFormat("{0} Patch modified. Sending (x,y) = ({1},{2})", LogHeader, x, y);
SendToClients(terrHeights, x, y);
shouldTaint = true;
}
}