From ed1e21a9bc8100a1e0b857cfb147663c24892251 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 28 Jan 2008 17:00:19 +0000 Subject: [PATCH] From Glen Waldon, "This change patches ReaderWriterOSGA.cpp so that it passes along the ReaderWriter::Options to files loaded from inside the archive. Previously it was discarding them. example: osgviewer -O noLoadExternalReferenceFiles archive.osga" --- src/osgPlugins/osga/ReaderWriterOSGA.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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());