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:
Robert Osfield 2008-04-01 10:11:22 +00:00
parent f9f7770336
commit e482e718f5
2 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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