diff --git a/src/osgPlugins/osga/ReaderWriterOSGA.cpp b/src/osgPlugins/osga/ReaderWriterOSGA.cpp index f7af8e313..e59ac7b47 100644 --- a/src/osgPlugins/osga/ReaderWriterOSGA.cpp +++ b/src/osgPlugins/osga/ReaderWriterOSGA.cpp @@ -58,7 +58,13 @@ public: if (!result.validArchive()) return result; - osg::ref_ptr local_options = new osgDB::ReaderWriter::Options; + // copy the incoming options if possible so that plugin options can be applied to files + // inside the archive + osg::ref_ptr local_options = + options? + new osgDB::ReaderWriter::Options( *options ) : + new osgDB::ReaderWriter::Options; + local_options->setDatabasePath(file); ReadResult result_2 = result.getArchive()->readImage(result.getArchive()->getMasterFileName(),local_options.get()); @@ -80,7 +86,13 @@ public: if (!result.validArchive()) return result; - osg::ref_ptr local_options = new osgDB::ReaderWriter::Options; + // copy the incoming options if possible so that plugin options can be applied to files + // inside the archive + osg::ref_ptr local_options = + options? + new osgDB::ReaderWriter::Options( *options ) : + new osgDB::ReaderWriter::Options; + local_options->setDatabasePath(file); ReadResult result_2 = result.getArchive()->readNode(result.getArchive()->getMasterFileName(),local_options.get());