Show
Ignore:
Timestamp:
04/24/14 19:26:46 (7 hours ago)
Author:
robert
Message:

From Farshid Lashkari, "I've attached a small fix to the Collada loader which prevents a null pointer access in some cases."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgUtil/TriStripVisitor.cpp

    r13488 r13502  
    215215void TriStripVisitor::stripify(Geometry& geom) 
    216216{ 
    217  
    218     if (geom.getNormalBinding()==osg::Geometry::BIND_PER_PRIMITIVE || 
    219         geom.getNormalBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return; 
    220  
    221     if (geom.getColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE || 
    222         geom.getColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return; 
    223  
    224     if (geom.getSecondaryColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE || 
    225         geom.getSecondaryColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return; 
    226  
    227     if (geom.getFogCoordBinding()==osg::Geometry::BIND_PER_PRIMITIVE || 
    228         geom.getFogCoordBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return; 
     217    if (geom.containsDeprecatedData()) geom.fixDeprecatedData(); 
     218 
     219    if (geom.getNormalBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return; 
     220 
     221    if (geom.getColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return; 
     222 
     223    if (geom.getSecondaryColorBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return; 
     224 
     225    if (geom.getFogCoordBinding()==osg::Geometry::BIND_PER_PRIMITIVE_SET) return; 
    229226 
    230227    // no point tri stripping if we don't have enough vertices.