]> git.mxchange.org Git - flightgear.git/commitdiff
fgviewer: Make use of the world texture when no file argument is given.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Sun, 4 Mar 2012 19:31:14 +0000 (20:31 +0100)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Sun, 4 Mar 2012 19:31:14 +0000 (20:31 +0100)
utils/fgviewer/fgviewer.cxx

index 515b41f2e506fa4cb5c52b5d8c9e2a885646c63b..f719b70a6b792a36c2882ac4c690d42a86cf497f 100644 (file)
@@ -189,9 +189,15 @@ main(int argc, char** argv)
     arguments.reportRemainingOptionsAsUnrecognized();
     arguments.writeErrorMessages(std::cerr);
 
-    // read the scene from the list of file specified command line args.
     osg::ref_ptr<osg::Node> loadedModel;
-    loadedModel = osgDB::readNodeFiles(arguments, options.get());
+    if (arguments.argc() != 1) {
+        // read the scene from the list of file specified command line args.
+        loadedModel = osgDB::readNodeFiles(arguments, options.get());
+    } else {
+        // if no arguments given resort to the whole world scenery
+        options->setPluginStringData("SimGear::FG_EARTH", "ON");
+        loadedModel = osgDB::readNodeFile("w180s90-360x180.spt", options.get());
+    }
 
     // if no model has been successfully loaded report failure.
     if (!loadedModel.valid()) {