From Paul Martz, "Two changes:
- Handle DrawArrays first/count correctly (fixes problem reported by Jason Daly) - Display warning if non-Geometry Drawable is encountered."
This commit is contained in:
parent
f9f7770336
commit
e482e718f5
@ -347,7 +347,12 @@ FltExportVisitor::apply( osg::Geode& node )
|
||||
{
|
||||
osg::Geometry* geom = node.getDrawable( idx )->asGeometry();
|
||||
if (!geom)
|
||||
{
|
||||
std::string warning( "fltexp: Non-Geometry Drawable encountered. Ignoring." );
|
||||
osg::notify( osg::WARN ) << warning << std::endl;
|
||||
_fltOpt->getWriteResult().warn( warning );
|
||||
continue;
|
||||
}
|
||||
|
||||
ScopedStatePushPop drawableGuard( this, geom->getStateSet() );
|
||||
|
||||
@ -381,7 +386,6 @@ FltExportVisitor::apply( osg::Geode& node )
|
||||
|
||||
// Would traverse here if this node could have children.
|
||||
// traverse( (osg::Node&)node );
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -139,7 +139,7 @@ FltExportVisitor::writeFace( const osg::Geode& geode, const osg::Geometry& geom,
|
||||
if (c && (c->size() > 0))
|
||||
{
|
||||
packedColorRaw = (*c)[0];
|
||||
transparency = (1. - packedColorRaw[3]) * (double)0xffff;
|
||||
transparency = flt::uint16((1. - packedColorRaw[3]) * (double)0xffff);
|
||||
}
|
||||
|
||||
if ( isLit( geom ) )
|
||||
@ -337,7 +337,7 @@ FltExportVisitor::writeMesh( const osg::Geode& geode, const osg::Geometry& geom,
|
||||
if (c && (c->size() > 0))
|
||||
{
|
||||
packedColorRaw = (*c)[0];
|
||||
transparency = (1. - packedColorRaw[3]) * (double)0xffff;
|
||||
transparency = flt::uint16((1. - packedColorRaw[3]) * (double)0xffff);
|
||||
}
|
||||
|
||||
if (isLit( geom ))
|
||||
@ -893,7 +893,8 @@ FltExportVisitor::handleDrawArrays( const osg::DrawArrays* da, const osg::Geomet
|
||||
}
|
||||
else
|
||||
{
|
||||
while (first+n <= da->getCount())
|
||||
const unsigned int max( first+count );
|
||||
while (first+n <= max)
|
||||
{
|
||||
// Need:
|
||||
// * Geode for record name (but also need to handle
|
||||
|
Loading…
Reference in New Issue
Block a user