X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fmodel%2FSGPagedLOD.cxx;h=545aadb72b91e8d38833ba11731db8dded3d4a3c;hb=d4c52b599dbd2b458709f05df2f7616a4025f59a;hp=b45af2046b9a55ecbca47272058c088896336dd3;hpb=7dc9eba2d0e98d9f08c7000b9424d28998755211;p=simgear.git diff --git a/simgear/scene/model/SGPagedLOD.cxx b/simgear/scene/model/SGPagedLOD.cxx index b45af204..545aadb7 100644 --- a/simgear/scene/model/SGPagedLOD.cxx +++ b/simgear/scene/model/SGPagedLOD.cxx @@ -50,19 +50,14 @@ bool SGPagedLOD::addChild(osg::Node *child) setRadius(getBound().radius()); setCenter(getBound().center()); - // if the model was an .xml-file it will have UserData set - osg::ref_ptr d = dynamic_cast(child->getUserData()); - if (d.valid()) - d->modelLoaded(getFileName(getNumChildren()-1), d->getProperties(), this); - else // this calls modelLoaded for non-xml models + SGReaderWriterXMLOptions* opts; + opts = dynamic_cast(_readerWriterOptions.get()); + if(opts) { - SGReaderWriterXMLOptions *o=dynamic_cast(_readerWriterOptions.get()); - if(o) - { - d = o->getModelData(); - if(d.valid()) - d->modelLoaded(getFileName(getNumChildren()-1), 0, this); - } + osg::ref_ptr d = opts->getModelData(); + if(d.valid()) + d->modelLoaded(getFileName(getNumChildren()-1), opts->getPropRoot(), + this); } return true; }