diff options
author | dahlia | 2013-11-01 01:40:56 -0700 |
---|---|---|
committer | dahlia | 2013-11-01 01:40:56 -0700 |
commit | f4ded3af63e4a71ffd8ee7f1a422ec600f59b845 (patch) | |
tree | 9d0c47d065c8ce81d41704e7e168b0efd3431b49 /OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |
parent | add new particle system blending rule enumerations (diff) | |
download | opensim-SC_OLD-f4ded3af63e4a71ffd8ee7f1a422ec600f59b845.zip opensim-SC_OLD-f4ded3af63e4a71ffd8ee7f1a422ec600f59b845.tar.gz opensim-SC_OLD-f4ded3af63e4a71ffd8ee7f1a422ec600f59b845.tar.bz2 opensim-SC_OLD-f4ded3af63e4a71ffd8ee7f1a422ec600f59b845.tar.xz |
discard alpha in 4-plane sculpt textures before generating physics proxy mesh
Diffstat (limited to '')
-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 | { |