[osg-users] BUG:osgPlugins\OpenFlight\ExportOptions.cpp

Argentieri, John-P63223 John.Argentieri at gdc4s.com
Tue Sep 16 17:07:05 PDT 2008

Paul/Robert/Anyone else who likes to fix OSG,

There is a problem in the file: osgPlugins\OpenFlight\ExportOptions.cpp

The initialization of "_stripFileTexturePath" is missing in the second
constructor. It happens to be a bool. So, if you pass in
osgDB::ReaderWriter::Options with an option string to specify the
version of flt output you want/any other options besides stripping
paths, you're also implicitly choosing to strip file paths out of your
textures, because most of the time a bool with unspecified value is
initialized to non-zero(true) because that's what most numbers (garbage
or not) are.

What should happen, is it should default to false and if it's a token in
the option string it becomes true.

Someone, please copy and paste the "_stripTextureFilePath( false )" line
into the second constructor and add a comma after "_lightingDefault(
true )". Don't forget the comma :)

Thanks guys. Your pal,
John Argentieri

  : _version( VERSION_16_1 ),
    _units( METERS ),
    _validate( false ),
    _lightingDefault( true ),
    _stripTextureFilePath( false )

ExportOptions::ExportOptions( const osgDB::ReaderWriter::Options* opt )
  : _version( VERSION_16_1 ),
    _units( METERS ),
    _validate( false ),
    _lightingDefault( true )
    if (opt)
        const ExportOptions* fltOpt = dynamic_cast<const
ExportOptions*>( opt );
        if (fltOpt)
            _version = fltOpt->_version;
            _units = fltOpt->_units;
            _validate = fltOpt->_validate;
            _tempDir = fltOpt->_tempDir;
            _lightingDefault = fltOpt->_lightingDefault;
        setOptionString( opt->getOptionString() );

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080916/88219f0e/attachment-0002.htm>

More information about the osg-users mailing list