diff options
Diffstat (limited to 'OpenSim/Region/Physics/Meshing/Meshmerizer.cs')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 16d65eb..e92ae50 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -629,10 +629,11 @@ namespace OpenSim.Region.Physics.Meshing | |||
629 | 629 | ||
630 | try | 630 | try |
631 | { | 631 | { |
632 | OpenMetaverse.Imaging.ManagedImage unusedData; | 632 | OpenMetaverse.Imaging.ManagedImage managedImage; |
633 | OpenMetaverse.Imaging.OpenJPEG.DecodeToImage(primShape.SculptData, out unusedData, out idata); | ||
634 | 633 | ||
635 | if (idata == null) | 634 | OpenMetaverse.Imaging.OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage); |
635 | |||
636 | if (managedImage == null) | ||
636 | { | 637 | { |
637 | // In some cases it seems that the decode can return a null bitmap without throwing | 638 | // In some cases it seems that the decode can return a null bitmap without throwing |
638 | // an exception | 639 | // an exception |
@@ -641,9 +642,12 @@ namespace OpenSim.Region.Physics.Meshing | |||
641 | return false; | 642 | return false; |
642 | } | 643 | } |
643 | 644 | ||
644 | unusedData = null; | 645 | if ((managedImage.Channels & OpenMetaverse.Imaging.ManagedImage.ImageChannels.Alpha) != 0) |
646 | managedImage.ConvertChannels(managedImage.Channels & ~OpenMetaverse.Imaging.ManagedImage.ImageChannels.Alpha); | ||
645 | 647 | ||
646 | //idata = CSJ2K.J2kImage.FromBytes(primShape.SculptData); | 648 | Bitmap imgData = OpenMetaverse.Imaging.LoadTGAClass.LoadTGA(new MemoryStream(managedImage.ExportTGA())); |
649 | idata = (Image)imgData; | ||
650 | managedImage = null; | ||
647 | 651 | ||
648 | if (cacheSculptMaps) | 652 | if (cacheSculptMaps) |
649 | { | 653 | { |