From: James Turner Date: Sat, 14 Aug 2010 18:48:52 +0000 (+0100) Subject: Allow loading of 2.5D panels to be controlled again. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=764a3c29e94b0d5e8e910586deb3dfcc8c7a4036;p=simgear.git Allow loading of 2.5D panels to be controlled again. --- diff --git a/simgear/scene/model/modellib.cxx b/simgear/scene/model/modellib.cxx index b47c57fd..cfa5b5c8 100644 --- a/simgear/scene/model/modellib.cxx +++ b/simgear/scene/model/modellib.cxx @@ -112,12 +112,16 @@ osg::Node* loadFile(const string& path, SGReaderWriterXMLOptions* options) osg::Node* SGModelLib::loadModel(const string &path, SGPropertyNode *prop_root, - SGModelData *data) + SGModelData *data, + bool load2DPanels) { osg::ref_ptr opt = new SGReaderWriterXMLOptions(*(osgDB::Registry::instance()->getOptions())); opt->setPropRoot(prop_root ? prop_root: static_propRoot.get()); opt->setModelData(data); - opt->setLoadPanel(static_panelFunc); + + if (load2DPanels) { + opt->setLoadPanel(static_panelFunc); + } osg::Node *n = loadFile(path, opt.get()); if (n && n->getName().empty()) diff --git a/simgear/scene/model/modellib.hxx b/simgear/scene/model/modellib.hxx index 7e093db3..bfc5c488 100644 --- a/simgear/scene/model/modellib.hxx +++ b/simgear/scene/model/modellib.hxx @@ -58,7 +58,7 @@ public: // data->modelLoaded() will be called after the model is loaded static osg::Node* loadModel(const std::string &path, SGPropertyNode *prop_root = NULL, - SGModelData *data=0); + SGModelData *data=0, bool load2DPanels=false); // Load a 3D model (any format) through the DatabasePager. // Most models should be loaded using this function!