From: Mathias Froehlich Date: Sun, 4 Mar 2012 16:09:24 +0000 (+0100) Subject: scenery: Do not use a seperate set of options for loading the model. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f5067b058c54ada4c2f7da14613fb3639702eac9;p=simgear.git scenery: Do not use a seperate set of options for loading the model. This fixes a problem introduced in commit 4e24095d8be43a8f6a2e060dfea4e7a4aec44ea5. Also this should fix Bug #698. --- diff --git a/simgear/scene/model/SGReaderWriterXML.cxx b/simgear/scene/model/SGReaderWriterXML.cxx index 83a2f59f..6f9a5c26 100644 --- a/simgear/scene/model/SGReaderWriterXML.cxx +++ b/simgear/scene/model/SGReaderWriterXML.cxx @@ -269,11 +269,9 @@ sgLoad3DModel_internal(const SGPath& path, if (!texturepath.extension().empty()) texturepath = texturepath.dir(); - osg::ref_ptr 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,