mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
varregion: remove serialization of region terrain to floats when sending patches.
This should eliminate much memory thrashing and CPU usage while sending initial terrain. The old way of passing terrain was to convert it to an array of floats. This is really bad for large terrain (think 4096x4096 floats). This change passes a dummy float array since the real region info is used anyway and the floats are ignored. (The ignoring the terrain floats is a kludge so as to not change IClientAPI.)
This commit is contained in:
@@ -853,7 +853,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
/// <param name="y">The patch corner to send</param>
|
||||
private void SendToClients(TerrainData terrData, int x, int y)
|
||||
{
|
||||
float[] heightMap = terrData.GetFloatsSerialized();
|
||||
// We know the actual terrain data passed is ignored. This kludge saves changing IClientAPI.
|
||||
//float[] heightMap = terrData.GetFloatsSerialized();
|
||||
float[] heightMap = new float[10];
|
||||
m_scene.ForEachClient(
|
||||
delegate(IClientAPI controller)
|
||||
{
|
||||
@@ -975,7 +977,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
protected void client_OnUnackedTerrain(IClientAPI client, int patchX, int patchY)
|
||||
{
|
||||
//m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
|
||||
client.SendLayerData(patchX, patchY, m_scene.Heightmap.GetFloatsSerialised());
|
||||
// SendLayerData does not use the heightmap parameter. This kludge is so as to not change IClientAPI.
|
||||
float[] heightMap = new float[10];
|
||||
client.SendLayerData(patchX, patchY, heightMap);
|
||||
}
|
||||
|
||||
private void StoreUndoState()
|
||||
|
||||
Reference in New Issue
Block a user