]> git.mxchange.org Git - simgear.git/commitdiff
scenery: Do not use a seperate set of options for loading the model.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Sun, 4 Mar 2012 16:09:24 +0000 (17:09 +0100)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Sun, 4 Mar 2012 16:09:24 +0000 (17:09 +0100)
This fixes a problem introduced in commit
4e24095d8be43a8f6a2e060dfea4e7a4aec44ea5.
Also this should fix Bug #698.

simgear/scene/model/SGReaderWriterXML.cxx

index 83a2f59fbf660c2442c7712d99f7e30ee80ffb54..6f9a5c261b5e7f83d4b184c44223eeda1922c0a7 100644 (file)
@@ -269,11 +269,9 @@ sgLoad3DModel_internal(const SGPath& path,
         if (!texturepath.extension().empty())
             texturepath = texturepath.dir();
 
-        osg::ref_ptr<SGReaderWriterOptions> options2;
-        options2 = new SGReaderWriterOptions(*options);
-        options2->setDatabasePath(texturepath.str());
+        options->setDatabasePath(texturepath.str());
         osgDB::ReaderWriter::ReadResult modelResult;
-        modelResult = osgDB::readNodeFile(modelpath.str(), options2.get());
+        modelResult = osgDB::readNodeFile(modelpath.str(), options.get());
         if (!modelResult.validNode())
             throw sg_io_exception("Failed to load 3D model:" + modelResult.message(),
                                   modelpath.str());
@@ -289,7 +287,7 @@ sgLoad3DModel_internal(const SGPath& path,
         model->addObserver(databaseReference);
 
         // Update liveries
-        TextureUpdateVisitor liveryUpdate(options2->getDatabasePathList());
+        TextureUpdateVisitor liveryUpdate(options->getDatabasePathList());
         model->accept(liveryUpdate);
 
         // Copy the userdata fields, still sharing the boundingvolumes,