From: frohlich Date: Thu, 11 Jun 2009 13:39:52 +0000 (+0000) Subject: Revert a change from 2009/06/07. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6fe3099ab4c642ae787ffa957c885bc1a073a7be;p=simgear.git Revert a change from 2009/06/07. Should make the Nasal code for some xml models work again. Modified Files: simgear/scene/model/SGPagedLOD.cxx simgear/scene/model/SGReaderWriterXML.cxx simgear/scene/model/modellib.cxx simgear/scene/model/modellib.hxx --- diff --git a/simgear/scene/model/SGPagedLOD.cxx b/simgear/scene/model/SGPagedLOD.cxx index 545aadb7..d66fee0d 100644 --- a/simgear/scene/model/SGPagedLOD.cxx +++ b/simgear/scene/model/SGPagedLOD.cxx @@ -56,8 +56,8 @@ bool SGPagedLOD::addChild(osg::Node *child) { osg::ref_ptr d = opts->getModelData(); if(d.valid()) - d->modelLoaded(getFileName(getNumChildren()-1), opts->getPropRoot(), - this); + d->modelLoaded(getFileName(getNumChildren()-1), + d->getConfigProperties(), this); } return true; } diff --git a/simgear/scene/model/SGReaderWriterXML.cxx b/simgear/scene/model/SGReaderWriterXML.cxx index 020547e3..9a6602ee 100644 --- a/simgear/scene/model/SGReaderWriterXML.cxx +++ b/simgear/scene/model/SGReaderWriterXML.cxx @@ -300,6 +300,7 @@ sgLoad3DModel_internal(const string &path, } if (data) { + data->setConfigProperties(props); options->setModelData(data); } diff --git a/simgear/scene/model/modellib.cxx b/simgear/scene/model/modellib.cxx index 3fbced89..4da108a1 100644 --- a/simgear/scene/model/modellib.cxx +++ b/simgear/scene/model/modellib.cxx @@ -67,7 +67,7 @@ SGModelLib::loadModel(const string &path, opt->setModelData(data); osg::Node *n = readNodeFile(path, opt.get()); if(data) - data->modelLoaded(path, prop_root, n); + data->modelLoaded(path, data->getConfigProperties(), n); if (n && n->getName().empty()) n->setName("Direct loaded model \"" + path + "\""); return n; diff --git a/simgear/scene/model/modellib.hxx b/simgear/scene/model/modellib.hxx index 7c38b10a..8840f400 100644 --- a/simgear/scene/model/modellib.hxx +++ b/simgear/scene/model/modellib.hxx @@ -85,6 +85,13 @@ public: virtual ~SGModelData() {} virtual void modelLoaded(const string& path, SGPropertyNode *prop, osg::Node* branch) = 0; + void setConfigProperties(SGPropertyNode *configProperties) + { _configProperties = configProperties; } + SGPropertyNode *getConfigProperties() + { return _configProperties; } + +private: + SGSharedPtr _configProperties; }; }