From af5ea18f33a8e259e2a2912c505ad5189d131fc7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 11 Oct 2015 23:04:22 +0100 Subject: use System.IO.Compression.DeflateStream for mesh decompression like master, since ACE zlib does seem to fail to decompress some meshs present at OSG, (possible same issue happens with map with option to draw prims) --- .../Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs index 7b13f6a..84df369 100644 --- a/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs +++ b/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs @@ -43,7 +43,6 @@ using log4net; using Nini.Config; using System.Reflection; using System.IO; -using ComponentAce.Compression.Libs.zlib; using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; @@ -449,22 +448,23 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing { using (MemoryStream outMs = new MemoryStream()) { - using (ZOutputStream zOut = new ZOutputStream(outMs)) + using (DeflateStream decompressionStream = new DeflateStream(inMs, CompressionMode.Decompress)) { byte[] readBuffer = new byte[2048]; + inMs.Read(readBuffer, 0, 2); // skip first 2 bytes in header int readLen = 0; - while ((readLen = inMs.Read(readBuffer, 0, readBuffer.Length)) > 0) - { - zOut.Write(readBuffer, 0, readLen); - } - zOut.Flush(); + + while ((readLen = decompressionStream.Read(readBuffer, 0, readBuffer.Length)) > 0) + outMs.Write(readBuffer, 0, readLen); + + outMs.Flush(); outMs.Seek(0, SeekOrigin.Begin); byte[] decompressedBuf = outMs.GetBuffer(); - decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf); + decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf); } - } + } } } catch (Exception e) -- cgit v1.1