From 0a96f4e1456d455cad83da23e72fc51e53d8eb3f Mon Sep 17 00:00:00 2001 From: Mathias Froehlich Date: Sun, 11 Mar 2012 14:20:33 +0100 Subject: [PATCH] scenery: Allow switching off particle systems on scenery load. --- simgear/scene/model/SGReaderWriterXML.cxx | 28 ++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/simgear/scene/model/SGReaderWriterXML.cxx b/simgear/scene/model/SGReaderWriterXML.cxx index 3a461328..17f23bc7 100644 --- a/simgear/scene/model/SGReaderWriterXML.cxx +++ b/simgear/scene/model/SGReaderWriterXML.cxx @@ -402,20 +402,22 @@ sgLoad3DModel_internal(const SGPath& path, } } - std::vector particle_nodes; - particle_nodes = props->getChildren("particlesystem"); - for (unsigned i = 0; i < particle_nodes.size(); ++i) { - osg::ref_ptr 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 particle_nodes; + particle_nodes = props->getChildren("particlesystem"); + for (unsigned i = 0; i < particle_nodes.size(); ++i) { + osg::ref_ptr 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 text_nodes;