diff --git a/src/osgPlugins/OpenFlight/FltExportVisitor.cpp b/src/osgPlugins/OpenFlight/FltExportVisitor.cpp index fc7f1a23b..7ad98a469 100644 --- a/src/osgPlugins/OpenFlight/FltExportVisitor.cpp +++ b/src/osgPlugins/OpenFlight/FltExportVisitor.cpp @@ -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 diff --git a/src/osgPlugins/OpenFlight/expGeometryRecords.cpp b/src/osgPlugins/OpenFlight/expGeometryRecords.cpp index 3a1311033..cddd62805 100644 --- a/src/osgPlugins/OpenFlight/expGeometryRecords.cpp +++ b/src/osgPlugins/OpenFlight/expGeometryRecords.cpp @@ -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