diff options
author | Robert Adams | 2014-06-01 19:22:26 -0700 |
---|---|---|
committer | Robert Adams | 2014-06-01 19:23:49 -0700 |
commit | 0aa0dad47868d6f64fa19f81b0f5daf35196fc3b (patch) | |
tree | 794ba1ab5af3733a109175414e934dcba2a42c50 /OpenSim/Region/CoreModules/World | |
parent | Fixes a permissions bug where a user with group powers to always rez was not ... (diff) | |
download | opensim-SC-0aa0dad47868d6f64fa19f81b0f5daf35196fc3b.zip opensim-SC-0aa0dad47868d6f64fa19f81b0f5daf35196fc3b.tar.gz opensim-SC-0aa0dad47868d6f64fa19f81b0f5daf35196fc3b.tar.bz2 opensim-SC-0aa0dad47868d6f64fa19f81b0f5daf35196fc3b.tar.xz |
Send multiple terrain patches per terrain update packet if terrain
draw distance optimization is enabled. Makes terrain editting a lot
snappier.
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index c22c5b6..51016c2 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -1035,12 +1035,24 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1035 | // LogHeader, toSend.Count, pups.Presence.Name, m_scene.RegionInfo.RegionName); | 1035 | // LogHeader, toSend.Count, pups.Presence.Name, m_scene.RegionInfo.RegionName); |
1036 | // Sort the patches to send by the distance from the presence | 1036 | // Sort the patches to send by the distance from the presence |
1037 | toSend.Sort(); | 1037 | toSend.Sort(); |
1038 | /* | ||
1038 | foreach (PatchesToSend pts in toSend) | 1039 | foreach (PatchesToSend pts in toSend) |
1039 | { | 1040 | { |
1040 | // TODO: one can send multiple patches in a packet. Do that. | ||
1041 | pups.Presence.ControllingClient.SendLayerData(pts.PatchX, pts.PatchY, null); | 1041 | pups.Presence.ControllingClient.SendLayerData(pts.PatchX, pts.PatchY, null); |
1042 | // presence.ControllingClient.SendLayerData(xs.ToArray(), ys.ToArray(), null, TerrainPatch.LayerType.Land); | 1042 | // presence.ControllingClient.SendLayerData(xs.ToArray(), ys.ToArray(), null, TerrainPatch.LayerType.Land); |
1043 | } | 1043 | } |
1044 | */ | ||
1045 | |||
1046 | int[] xPieces = new int[toSend.Count]; | ||
1047 | int[] yPieces = new int[toSend.Count]; | ||
1048 | float[] patchPieces = new float[toSend.Count * 2]; | ||
1049 | int pieceIndex = 0; | ||
1050 | foreach (PatchesToSend pts in toSend) | ||
1051 | { | ||
1052 | patchPieces[pieceIndex++] = pts.PatchX; | ||
1053 | patchPieces[pieceIndex++] = pts.PatchY; | ||
1054 | } | ||
1055 | pups.Presence.ControllingClient.SendLayerData(-toSend.Count, 0, patchPieces); | ||
1044 | } | 1056 | } |
1045 | } | 1057 | } |
1046 | } | 1058 | } |