]> git.mxchange.org Git - simgear.git/commitdiff
Revert a change from 2009/06/07.
authorfrohlich <frohlich>
Thu, 11 Jun 2009 13:39:52 +0000 (13:39 +0000)
committerTim Moore <timoore@redhat.com>
Mon, 15 Jun 2009 08:23:21 +0000 (10:23 +0200)
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

simgear/scene/model/SGPagedLOD.cxx
simgear/scene/model/SGReaderWriterXML.cxx
simgear/scene/model/modellib.cxx
simgear/scene/model/modellib.hxx

index 545aadb72b91e8d38833ba11731db8dded3d4a3c..d66fee0d5306a1737c9f5ddd18161bf75243bb97 100644 (file)
@@ -56,8 +56,8 @@ bool SGPagedLOD::addChild(osg::Node *child)
     {
         osg::ref_ptr<SGModelData> d = opts->getModelData();
         if(d.valid())
-            d->modelLoaded(getFileName(getNumChildren()-1), opts->getPropRoot(),
-                           this);
+            d->modelLoaded(getFileName(getNumChildren()-1),
+                           d->getConfigProperties(), this);
     }
     return true;
 }
index 020547e3e74ff4cfda524762f4bd28140c3cb78d..9a6602ee02d764276bb6220a507b15be6a5d72ef 100644 (file)
@@ -300,6 +300,7 @@ sgLoad3DModel_internal(const string &path,
     }
 
     if (data) {
+        data->setConfigProperties(props);
         options->setModelData(data);
     }
 
index 3fbced89ba4e846478654b22c727bbb9817b17e0..4da108a1d2c63065a013c1908805b104fa9b1e2b 100644 (file)
@@ -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;
index 7c38b10abedd6adcfcf659d601a7b5b1452145db..8840f400aa80fa98a5614f8fe1939e3f08d0d1d1 100644 (file)
@@ -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<SGPropertyNode> _configProperties;
 };
 
 }