aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs
diff options
context:
space:
mode:
authorUbitUmarov2015-10-11 23:04:22 +0100
committerUbitUmarov2015-10-11 23:04:22 +0100
commitaf5ea18f33a8e259e2a2912c505ad5189d131fc7 (patch)
tree1325dc90d1301d67f5e5c58c4cac08a27f9cb8bb /OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs
parent display prim name, if unzip of selected phsyics mesh part fails on ubMeshmer... (diff)
downloadopensim-SC-af5ea18f33a8e259e2a2912c505ad5189d131fc7.zip
opensim-SC-af5ea18f33a8e259e2a2912c505ad5189d131fc7.tar.gz
opensim-SC-af5ea18f33a8e259e2a2912c505ad5189d131fc7.tar.bz2
opensim-SC-af5ea18f33a8e259e2a2912c505ad5189d131fc7.tar.xz
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)
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOdeMeshing/Meshmerizer.cs18
1 files changed, 9 insertions, 9 deletions
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;
43using Nini.Config; 43using Nini.Config;
44using System.Reflection; 44using System.Reflection;
45using System.IO; 45using System.IO;
46using ComponentAce.Compression.Libs.zlib;
47using System.Runtime.Serialization; 46using System.Runtime.Serialization;
48using System.Runtime.Serialization.Formatters.Binary; 47using System.Runtime.Serialization.Formatters.Binary;
49 48
@@ -449,22 +448,23 @@ namespace OpenSim.Region.PhysicsModule.ubODEMeshing
449 { 448 {
450 using (MemoryStream outMs = new MemoryStream()) 449 using (MemoryStream outMs = new MemoryStream())
451 { 450 {
452 using (ZOutputStream zOut = new ZOutputStream(outMs)) 451 using (DeflateStream decompressionStream = new DeflateStream(inMs, CompressionMode.Decompress))
453 { 452 {
454 byte[] readBuffer = new byte[2048]; 453 byte[] readBuffer = new byte[2048];
454 inMs.Read(readBuffer, 0, 2); // skip first 2 bytes in header
455 int readLen = 0; 455 int readLen = 0;
456 while ((readLen = inMs.Read(readBuffer, 0, readBuffer.Length)) > 0) 456
457 { 457 while ((readLen = decompressionStream.Read(readBuffer, 0, readBuffer.Length)) > 0)
458 zOut.Write(readBuffer, 0, readLen); 458 outMs.Write(readBuffer, 0, readLen);
459 } 459
460 zOut.Flush(); 460 outMs.Flush();
461 outMs.Seek(0, SeekOrigin.Begin); 461 outMs.Seek(0, SeekOrigin.Begin);
462 462
463 byte[] decompressedBuf = outMs.GetBuffer(); 463 byte[] decompressedBuf = outMs.GetBuffer();
464 464
465 decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf); 465 decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf);
466 } 466 }
467 } 467 }
468 } 468 }
469 } 469 }
470 catch (Exception e) 470 catch (Exception e)