diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-08 00:10:19 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-08 00:10:19 -0400 |
commit | bff26ccdbb94fbdf9623b0b00a16ef88549e648e (patch) | |
tree | 96b56e7c29b16f057ec8727744e2c920a34f51e9 /OpenSim/Region/ClientStack | |
parent | Merge branch 'master' of ssh://melanie@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-bff26ccdbb94fbdf9623b0b00a16ef88549e648e.zip opensim-SC-bff26ccdbb94fbdf9623b0b00a16ef88549e648e.tar.gz opensim-SC-bff26ccdbb94fbdf9623b0b00a16ef88549e648e.tar.bz2 opensim-SC-bff26ccdbb94fbdf9623b0b00a16ef88549e648e.tar.xz |
* More tweaking of the various services to work with nonstandard region sizes. * Now, what's available of the terrain will show and it'll be truncated if it's larger on Linden Clients. Parcel minimum is 64 (256/4) for the client to accept it.
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 9142b36..d8f786b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -1457,7 +1457,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1457 | //} | 1457 | //} |
1458 | for (int x = 0; x < 16; x++) | 1458 | for (int x = 0; x < 16; x++) |
1459 | { | 1459 | { |
1460 | SendLayerData(x, y, map); | 1460 | SendLayerData(x, y, LLHeightFieldMoronize(map)); |
1461 | Thread.Sleep(35); | 1461 | Thread.Sleep(35); |
1462 | } | 1462 | } |
1463 | } | 1463 | } |
@@ -1503,7 +1503,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1503 | 1503 | ||
1504 | patches[0] = patchx + 0 + patchy * 16; | 1504 | patches[0] = patchx + 0 + patchy * 16; |
1505 | 1505 | ||
1506 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(map, patches); | 1506 | LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(((map.Length==65536)? map : LLHeightFieldMoronize(map)), patches); |
1507 | layerpack.Header.Zerocoded = true; | 1507 | layerpack.Header.Zerocoded = true; |
1508 | 1508 | ||
1509 | OutPacket(layerpack, ThrottleOutPacketType.Land); | 1509 | OutPacket(layerpack, ThrottleOutPacketType.Land); |
@@ -1516,6 +1516,39 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1516 | } | 1516 | } |
1517 | 1517 | ||
1518 | /// <summary> | 1518 | /// <summary> |
1519 | /// Munges heightfield into the LLUDP backed in restricted heightfield. | ||
1520 | /// </summary> | ||
1521 | /// <param name="map">float array in the base; Constants.RegionSize</param> | ||
1522 | /// <returns>float array in the base 256</returns> | ||
1523 | internal float[] LLHeightFieldMoronize(float[] map) | ||
1524 | { | ||
1525 | if (map.Length == 65536) | ||
1526 | return map; | ||
1527 | else | ||
1528 | { | ||
1529 | float[] returnmap = new float[65536]; | ||
1530 | |||
1531 | if (map.Length < 65535) | ||
1532 | { | ||
1533 | // rebase the vector stride to 256 | ||
1534 | for (int i = 0; i < Constants.RegionSize; i++) | ||
1535 | Array.Copy(map, i * (int)Constants.RegionSize, returnmap, i * 256, (int)Constants.RegionSize); | ||
1536 | } | ||
1537 | else | ||
1538 | { | ||
1539 | for (int i = 0; i < 256; i++) | ||
1540 | Array.Copy(map, i * (int)Constants.RegionSize, returnmap, i * 256, 256); | ||
1541 | } | ||
1542 | |||
1543 | |||
1544 | //Array.Copy(map,0,returnmap,0,(map.Length < 65536)? map.Length : 65536); | ||
1545 | |||
1546 | return returnmap; | ||
1547 | } | ||
1548 | |||
1549 | } | ||
1550 | |||
1551 | /// <summary> | ||
1519 | /// Send the wind matrix to the client | 1552 | /// Send the wind matrix to the client |
1520 | /// </summary> | 1553 | /// </summary> |
1521 | /// <param name="windSpeeds">16x16 array of wind speeds</param> | 1554 | /// <param name="windSpeeds">16x16 array of wind speeds</param> |