diff options
author | dahlia | 2013-12-06 15:58:19 -0800 |
---|---|---|
committer | dahlia | 2013-12-06 15:58:19 -0800 |
commit | 1496de7ce99079d3d7bf046db088c3d6e2a97bcb (patch) | |
tree | 607e4c25947264bd0bd4ec57b209346d172ec150 /OpenSim | |
parent | Actually use the SP.AgentControlStopSlowWhilstMoving parameter intoroduced fo... (diff) | |
download | opensim-SC-1496de7ce99079d3d7bf046db088c3d6e2a97bcb.zip opensim-SC-1496de7ce99079d3d7bf046db088c3d6e2a97bcb.tar.gz opensim-SC-1496de7ce99079d3d7bf046db088c3d6e2a97bcb.tar.bz2 opensim-SC-1496de7ce99079d3d7bf046db088c3d6e2a97bcb.tar.xz |
use System.IO.Compression.DeflateStream for mesh decompression in an attempt to reduce mesh asset decoding failures
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 1f08b03..e313a30 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -40,7 +40,6 @@ using log4net; | |||
40 | using Nini.Config; | 40 | using Nini.Config; |
41 | using System.Reflection; | 41 | using System.Reflection; |
42 | using System.IO; | 42 | using System.IO; |
43 | using ComponentAce.Compression.Libs.zlib; | ||
44 | 43 | ||
45 | namespace OpenSim.Region.Physics.Meshing | 44 | namespace OpenSim.Region.Physics.Meshing |
46 | { | 45 | { |
@@ -549,7 +548,6 @@ namespace OpenSim.Region.Physics.Meshing | |||
549 | return true; | 548 | return true; |
550 | } | 549 | } |
551 | 550 | ||
552 | |||
553 | /// <summary> | 551 | /// <summary> |
554 | /// decompresses a gzipped OSD object | 552 | /// decompresses a gzipped OSD object |
555 | /// </summary> | 553 | /// </summary> |
@@ -564,15 +562,13 @@ namespace OpenSim.Region.Physics.Meshing | |||
564 | { | 562 | { |
565 | using (MemoryStream outMs = new MemoryStream()) | 563 | using (MemoryStream outMs = new MemoryStream()) |
566 | { | 564 | { |
567 | using (ZOutputStream zOut = new ZOutputStream(outMs)) | 565 | using (DeflateStream decompressionStream = new DeflateStream(inMs, CompressionMode.Decompress)) |
568 | { | 566 | { |
569 | byte[] readBuffer = new byte[2048]; | 567 | byte[] readBuffer = new byte[2048]; |
570 | int readLen = 0; | 568 | inMs.Read(readBuffer, 0, 2); // skip first 2 bytes in header |
571 | while ((readLen = inMs.Read(readBuffer, 0, readBuffer.Length)) > 0) | 569 | |
572 | { | 570 | decompressionStream.CopyTo(outMs); |
573 | zOut.Write(readBuffer, 0, readLen); | 571 | |
574 | } | ||
575 | zOut.Flush(); | ||
576 | outMs.Seek(0, SeekOrigin.Begin); | 572 | outMs.Seek(0, SeekOrigin.Begin); |
577 | 573 | ||
578 | byte[] decompressedBuf = outMs.GetBuffer(); | 574 | byte[] decompressedBuf = outMs.GetBuffer(); |