Send multiple terrain patches per terrain update packet if terrain

draw distance optimization is enabled. Makes terrain editting a lot
snappier.
This commit is contained in:
Robert Adams
2014-06-01 19:22:26 -07:00
parent 3aa99b9a7f
commit 0aa0dad478
3 changed files with 118 additions and 27 deletions

View File

@@ -119,6 +119,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
xPieces[0] = patchX; // patch X dimension
yPieces[0] = patchY;
return CreateLandPacket(terrData, xPieces, yPieces);
}
public static LayerDataPacket CreateLandPacket(TerrainData terrData, int[] xPieces, int[] yPieces)
{
byte landPacketType = (byte)TerrainPatch.LayerType.Land;
if (terrData.SizeX > Constants.RegionSize || terrData.SizeY > Constants.RegionSize)
{
@@ -148,8 +153,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// Array of indexes in the grid of patches.
/// </param>
/// <param name="type"></param>
/// <param name="pRegionSizeX"></param>
/// <param name="pRegionSizeY"></param>
/// <returns></returns>
public static LayerDataPacket CreateLandPacket(TerrainData terrData, int[] x, int[] y, byte type)
{