From 8136cf4075216d09738b8707258581e6db755759 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Sat, 4 Apr 2009 15:43:02 +0000 Subject: Thanks jonc, for a patch that adds rendering of classic clouds. First part of Mantis #964, the necessary clouds image will follow separately. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 39 +++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 5c86964..9b2f0ef 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -1360,7 +1360,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } /// - /// Send the region heightmap to the client + /// Send the wind matrix to the client /// /// 16x16 array of wind speeds public virtual void SendWindData(Vector2[] windSpeeds) @@ -1369,13 +1369,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP } /// - /// Send terrain layer information to the client. + /// Send the cloud matrix to the client + /// + /// 16x16 array of cloud densities + public virtual void SendCloudData(float[] cloudDensity) + { + ThreadPool.QueueUserWorkItem(new WaitCallback(DoSendCloudData), (object)cloudDensity); + } + + /// + /// Send wind layer information to the client. /// /// private void DoSendWindData(object o) { Vector2[] windSpeeds = (Vector2[])o; - TerrainPatch[] patches = new TerrainPatch[2]; patches[0] = new TerrainPatch(); patches[0].Data = new float[16 * 16]; @@ -1393,11 +1401,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP LayerDataPacket layerpack = TerrainCompressor.CreateLayerDataPacket(patches, TerrainPatch.LayerType.Wind); layerpack.Header.Zerocoded = true; - OutPacket(layerpack, ThrottleOutPacketType.Wind); } /// + /// Send cloud layer information to the client. + /// + /// + private void DoSendCloudData(object o) + { + float[] cloudCover = (float[])o; + TerrainPatch[] patches = new TerrainPatch[1]; + patches[0] = new TerrainPatch(); + patches[0].Data = new float[16 * 16]; + + for (int y = 0; y < 16; y++) + { + for (int x = 0; x < 16; x++) + { + patches[0].Data[y * 16 + x] = cloudCover[y * 16 + x]; + } + } + + LayerDataPacket layerpack = TerrainCompressor.CreateLayerDataPacket(patches, TerrainPatch.LayerType.Cloud); + layerpack.Header.Zerocoded = true; + OutPacket(layerpack, ThrottleOutPacketType.Cloud); + } + + /// /// Tell the client that the given neighbour region is ready to receive a child agent. /// public virtual void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint) -- cgit v1.1