]> git.mxchange.org Git - simgear.git/commitdiff
Improve the <usage> tag feature
authorClément de l'Hamaide <clemaez@hotmail.fr>
Sun, 21 Sep 2014 20:05:45 +0000 (22:05 +0200)
committerClément de l'Hamaide <clemaez@hotmail.fr>
Sun, 21 Sep 2014 20:05:45 +0000 (22:05 +0200)
Do not load the <model> if <usage> tag is found as child.
Instead the load is triggered later by FlightGear

simgear/scene/model/SGReaderWriterXML.cxx

index 83d6d36dadd4731e8769645c4088248912fa3783..744c5dfd63667cfde20076f0e4b6d9d04e2d1482 100644 (file)
@@ -409,6 +409,15 @@ sgLoad3DModel_internal(const SGPath& path,
           continue;
         }
 
+        if(sub_props->hasChild("usage")){ /* We don't want load this file and its content now */
+            bool isInterior = (std::string(sub_props->getStringValue("usage")) == "interior");
+            bool isAI = (std::string(prop_root->getStringValue("type")) == "AI");
+            if(isInterior && isAI){
+                 props->addChild("interior-path")->setStringValue(submodelPath.str());
+                 continue;
+            }
+        }
+
         try {
             submodel = sgLoad3DModel_internal(submodelPath, options.get(),
                                               sub_props->getNode("overlay"));