From Dean Iversion, fix to the ReaderWriter::Options management in Pool.cpp

This commit is contained in:
Robert Osfield
2003-11-11 08:52:41 +00:00
parent 8bbbd1fc70
commit 21881490cd

View File

@@ -155,9 +155,14 @@ flt::AttrData* TexturePool::getTexture(int nIndex, int fltVersion)
char options[256];
sprintf(options,"FLT_VER %d",fltVersion);
// Add this line to save the existing options
osg::ref_ptr<osgDB::ReaderWriter::Options> oldOptions = osgDB::Registry::instance()->getOptions();
osgDB::Registry::instance()->setOptions(new osgDB::ReaderWriter::Options(options));
textureAttrData = dynamic_cast<flt::AttrData*>(osgDB::readObjectFile(attrName));
osgDB::Registry::instance()->setOptions(NULL); // Delete options
// Changed this line to restore the old options
osgDB::Registry::instance()->setOptions( oldOptions.get() ); // Restore options
// if not found create default StateSet for the AttrData
if (textureAttrData == NULL)