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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -300,6 +300,7 @@ sgLoad3DModel_internal(const string &path,
|
||||
}
|
||||
|
||||
if (data) {
|
||||
data->setConfigProperties(props);
|
||||
options->setModelData(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user