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
This commit is contained in:
frohlich
2009-06-11 13:39:52 +00:00
committed by Tim Moore
parent a34eceb327
commit 6fe3099ab4
4 changed files with 11 additions and 3 deletions

View 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;
}

View File

@@ -300,6 +300,7 @@ sgLoad3DModel_internal(const string &path,
}
if (data) {
data->setConfigProperties(props);
options->setModelData(data);
}

View 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;

View 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;
};
}