]> git.mxchange.org Git - simgear.git/commitdiff
if a model XML file contains a <multiplayer> block, copy its contents
authormfranz <mfranz>
Thu, 9 Oct 2008 22:20:33 +0000 (22:20 +0000)
committermfranz <mfranz>
Thu, 9 Oct 2008 22:20:33 +0000 (22:20 +0000)
 to the model's property root (/ai/models/multiplayer[*])

simgear/scene/model/SGReaderWriterXML.cxx

index 2d48e7e20e07a582e418c78736a9381dbff06e7b..2ceb0f89f2e459d73621c853cada26d0a526cab7 100644 (file)
@@ -135,8 +135,8 @@ sgLoad3DModel_internal(const string &path,
 {
     if ( !prop_root ) {
         SG_LOG(SG_GENERAL, SG_ALERT, "prop_root NULL: " << path);
-
     }
+
     string fg_root=osgDB::Registry::instance()->getDataFilePathList().front();
     osg::ref_ptr<osg::Node> model;
     osg::ref_ptr<osg::Group> group;
@@ -168,6 +168,10 @@ sgLoad3DModel_internal(const string &path,
         } else {
             model = new osg::Node;
         }
+
+        SGPropertyNode *mp = props->getNode("multiplayer");
+        if (mp && prop_root && prop_root->getParent())
+            copyProperties(mp, prop_root);
     }
 
     osg::ref_ptr<osgDB::ReaderWriter::Options> options