]> git.mxchange.org Git - simgear.git/commitdiff
scenery: Allow switching off particle systems on scenery load.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Sun, 11 Mar 2012 13:20:33 +0000 (14:20 +0100)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Sun, 11 Mar 2012 13:20:33 +0000 (14:20 +0100)
simgear/scene/model/SGReaderWriterXML.cxx

index 3a461328f9ad4943f4ed9db8b924caf869451c3d..17f23bc75877e553919db0a6bfb57caee24e3168 100644 (file)
@@ -402,20 +402,22 @@ sgLoad3DModel_internal(const SGPath& path,
         }
     }
 
-    std::vector<SGPropertyNode_ptr> particle_nodes;
-    particle_nodes = props->getChildren("particlesystem");
-    for (unsigned i = 0; i < particle_nodes.size(); ++i) {
-        osg::ref_ptr<SGReaderWriterOptions> options2;
-        options2 = new SGReaderWriterOptions(*options);
-        if (i==0) {
-            if (!texturepath.extension().empty())
-                texturepath = texturepath.dir();
-
-            options2->setDatabasePath(texturepath.str());
+    if (dbOptions->getPluginStringData("SimGear::PARTICLESYSTEM") != "OFF") {
+        std::vector<SGPropertyNode_ptr> particle_nodes;
+        particle_nodes = props->getChildren("particlesystem");
+        for (unsigned i = 0; i < particle_nodes.size(); ++i) {
+            osg::ref_ptr<SGReaderWriterOptions> options2;
+            options2 = new SGReaderWriterOptions(*options);
+            if (i==0) {
+                if (!texturepath.extension().empty())
+                    texturepath = texturepath.dir();
+                
+                options2->setDatabasePath(texturepath.str());
+            }
+            group->addChild(Particles::appendParticles(particle_nodes[i],
+                                                       prop_root,
+                                                       options2.get()));
         }
-        group->addChild(Particles::appendParticles(particle_nodes[i],
-                        prop_root,
-                        options2.get()));
     }
 
     std::vector<SGPropertyNode_ptr> text_nodes;