]> git.mxchange.org Git - simgear.git/commitdiff
Cleanup.
authorfrohlich <frohlich>
Sun, 7 Jun 2009 11:27:53 +0000 (11:27 +0000)
committerTim Moore <timoore@redhat.com>
Thu, 11 Jun 2009 13:55:11 +0000 (15:55 +0200)
Modified Files:
simgear/scene/model/SGReaderWriterXML.cxx

simgear/scene/model/SGReaderWriterXML.cxx

index f6189274cd9c1c4d9c01c9a418e476dcb761df87..f3fb644ba3ebdb49c07782d092bd0b4779de41c2 100644 (file)
@@ -188,7 +188,7 @@ sgLoad3DModel_internal(const string &path,
     // Assume that textures are in
     // the same location as the XML file.
     if (!model) {
-        if (texturepath.extension() != "")
+        if (!texturepath.extension().empty())
             texturepath = texturepath.dir();
 
         options->setDatabasePath(texturepath.str());
@@ -301,7 +301,7 @@ sgLoad3DModel_internal(const string &path,
     particle_nodes = props->getChildren("particlesystem");
     for (unsigned i = 0; i < particle_nodes.size(); ++i) {
         if (i==0) {
-            if (texturepath.extension() != "")
+            if (!texturepath.extension().empty())
                 texturepath = texturepath.dir();
 
             options->setDatabasePath(texturepath.str());
@@ -322,17 +322,17 @@ sgLoad3DModel_internal(const string &path,
         SGAnimation::animate(group.get(), animation_nodes[i], prop_root,
                              options.get());
 
-    if (props->hasChild("debug-outfile")) {
-        std::string outputfile = props->getStringValue("debug-outfile",
-                                 "debug-model.osg");
-        osgDB::writeNodeFile(*group, outputfile);
-    }
     if (!needTransform && group->getNumChildren() < 2) {
         model = group->getChild(0);
         group->removeChild(model.get());
         model->setUserData(group->getUserData());
         return model.release();
     }
+    if (props->hasChild("debug-outfile")) {
+        std::string outputfile = props->getStringValue("debug-outfile",
+                                 "debug-model.osg");
+        osgDB::writeNodeFile(*group, outputfile);
+    }
 
     return group.release();
 }