diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index fc679e7..4ad0cb1 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -629,21 +629,16 @@ 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); |
636 | { | ||
637 | // In some cases it seems that the decode can return a null bitmap without throwing | ||
638 | // an exception | ||
639 | m_log.WarnFormat("[PHYSICS]: OpenJPEG decoded sculpt data for {0} to a null bitmap. Ignoring.", primName); | ||
640 | |||
641 | return false; | ||
642 | } | ||
643 | 635 | ||
644 | unusedData = null; | 636 | if ((managedImage.Channels & OpenMetaverse.Imaging.ManagedImage.ImageChannels.Alpha) != 0) |
637 | managedImage.ConvertChannels(managedImage.Channels & ~OpenMetaverse.Imaging.ManagedImage.ImageChannels.Alpha); | ||
645 | 638 | ||
646 | //idata = CSJ2K.J2kImage.FromBytes(primShape.SculptData); | 639 | Bitmap imgData = OpenMetaverse.Imaging.LoadTGAClass.LoadTGA(new MemoryStream(managedImage.ExportTGA())); |
640 | idata = (Image)imgData; | ||
641 | managedImage = null; | ||
647 | 642 | ||
648 | if (cacheSculptMaps) | 643 | if (cacheSculptMaps) |
649 | { | 644 | { |