diff options
author | UbitUmarov | 2016-09-23 16:04:43 +0100 |
---|---|---|
committer | UbitUmarov | 2016-09-23 16:04:43 +0100 |
commit | f5189b2cdd672734137a76f46379d225ed7c79e3 (patch) | |
tree | d2ee9f0e6626ffde96305234b28f47c1e97e8f87 /OpenSim/Region/ClientStack/Linden | |
parent | cache wind compressed data so cpu burning compression is only done after a ch... (diff) | |
download | opensim-SC_OLD-f5189b2cdd672734137a76f46379d225ed7c79e3.zip opensim-SC_OLD-f5189b2cdd672734137a76f46379d225ed7c79e3.tar.gz opensim-SC_OLD-f5189b2cdd672734137a76f46379d225ed7c79e3.tar.bz2 opensim-SC_OLD-f5189b2cdd672734137a76f46379d225ed7c79e3.tar.xz |
do the same for legacy clouds (still visible on older viewer ie singu 1.8.7). Fix clouds update. Send clouds and wind also to child agents.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 5f8d8f1..90f0336 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -1390,11 +1390,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1390 | /// Send the cloud matrix to the client | 1390 | /// Send the cloud matrix to the client |
1391 | /// </summary> | 1391 | /// </summary> |
1392 | /// <param name="windSpeeds">16x16 array of cloud densities</param> | 1392 | /// <param name="windSpeeds">16x16 array of cloud densities</param> |
1393 | /* | ||
1393 | public virtual void SendCloudData(int version, float[] cloudDensity) | 1394 | public virtual void SendCloudData(int version, float[] cloudDensity) |
1394 | { | 1395 | { |
1395 | Util.FireAndForget(DoSendCloudData, cloudDensity, "LLClientView.SendCloudData"); | 1396 | Util.FireAndForget(DoSendCloudData, cloudDensity, "LLClientView.SendCloudData"); |
1396 | } | 1397 | } |
1397 | 1398 | */ | |
1398 | // wind caching | 1399 | // wind caching |
1399 | private static int lastWindVersion = 0; | 1400 | private static int lastWindVersion = 0; |
1400 | private static List<LayerDataPacket> lastWindPackets = new List<LayerDataPacket>(); | 1401 | private static List<LayerDataPacket> lastWindPackets = new List<LayerDataPacket>(); |
@@ -1445,30 +1446,53 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
1445 | OutPacket(pkt, ThrottleOutPacketType.Wind); | 1446 | OutPacket(pkt, ThrottleOutPacketType.Wind); |
1446 | } | 1447 | } |
1447 | 1448 | ||
1449 | // cloud caching | ||
1450 | private static int lastCloudVersion = 0; | ||
1451 | private static List<LayerDataPacket> lastCloudPackets = new List<LayerDataPacket>(); | ||
1452 | |||
1448 | /// <summary> | 1453 | /// <summary> |
1449 | /// Send cloud layer information to the client. | 1454 | /// Send cloud layer information to the client. |
1450 | /// </summary> | 1455 | /// </summary> |
1451 | /// <param name="o"></param> | 1456 | /// <param name="o"></param> |
1452 | private void DoSendCloudData(object o) | 1457 | // private void DoSendCloudData(object o) |
1458 | public virtual void SendCloudData(int version, float[] cloudDensity) | ||
1453 | { | 1459 | { |
1454 | float[] cloudCover = (float[])o; | 1460 | // float[] cloudDensity = (float[])o; |
1455 | TerrainPatch[] patches = new TerrainPatch[1]; | 1461 | bool isNewData; |
1456 | patches[0] = new TerrainPatch(); | 1462 | lock(lastCloudPackets) |
1457 | patches[0].Data = new float[16 * 16]; | 1463 | isNewData = lastCloudVersion != version; |
1458 | 1464 | ||
1459 | for (int y = 0; y < 16; y++) | 1465 | if(isNewData) |
1460 | { | 1466 | { |
1461 | for (int x = 0; x < 16; x++) | 1467 | TerrainPatch[] patches = new TerrainPatch[1]; |
1468 | patches[0] = new TerrainPatch(); | ||
1469 | patches[0].Data = new float[16 * 16]; | ||
1470 | |||
1471 | for (int y = 0; y < 16; y++) | ||
1472 | { | ||
1473 | for (int x = 0; x < 16; x++) | ||
1474 | { | ||
1475 | patches[0].Data[y * 16 + x] = cloudDensity[y * 16 + x]; | ||
1476 | } | ||
1477 | } | ||
1478 | // neither we or viewers have extended clouds | ||
1479 | byte layerType = (byte)TerrainPatch.LayerType.Cloud; | ||
1480 | |||
1481 | LayerDataPacket layerpack = | ||
1482 | OpenSimTerrainCompressor.CreateLayerDataPacketStandardSize( | ||
1483 | patches, layerType); | ||
1484 | layerpack.Header.Zerocoded = true; | ||
1485 | lock(lastCloudPackets) | ||
1462 | { | 1486 | { |
1463 | patches[0].Data[y * 16 + x] = cloudCover[y * 16 + x]; | 1487 | lastCloudPackets.Clear(); |
1488 | lastCloudPackets.Add(layerpack); | ||
1489 | lastCloudVersion = version; | ||
1464 | } | 1490 | } |
1465 | } | 1491 | } |
1466 | // neither we or viewers have extended clouds | ||
1467 | byte layerType = (byte)TerrainPatch.LayerType.Cloud; | ||
1468 | 1492 | ||
1469 | LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLayerDataPacketStandardSize(patches, layerType); | 1493 | lock(lastCloudPackets) |
1470 | layerpack.Header.Zerocoded = true; | 1494 | foreach(LayerDataPacket pkt in lastCloudPackets) |
1471 | OutPacket(layerpack, ThrottleOutPacketType.Cloud); | 1495 | OutPacket(pkt, ThrottleOutPacketType.Cloud); |
1472 | } | 1496 | } |
1473 | 1497 | ||
1474 | /// <summary> | 1498 | /// <summary> |