]> git.mxchange.org Git - simgear.git/commitdiff
Allow loading of 2.5D panels to be controlled again.
authorJames Turner <zakalawe@mac.com>
Sat, 14 Aug 2010 18:48:52 +0000 (19:48 +0100)
committerJames Turner <zakalawe@mac.com>
Sat, 14 Aug 2010 18:48:52 +0000 (19:48 +0100)
simgear/scene/model/modellib.cxx
simgear/scene/model/modellib.hxx

index b47c57fdfe6f136698f0cc347c48ea1d23cf5ddf..cfa5b5c8d7f2553d8a587ec60bfbbc055f2539a1 100644 (file)
@@ -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<SGReaderWriterXMLOptions> 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())
index 7e093db3f714994f64ffe9a608fe4d7b0562e9c0..bfc5c4889852320615a30b93a2647bbc4ffe6fb6 100644 (file)
@@ -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!