]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fgviewer.cxx
Merge branch 'csaba/nan'
[flightgear.git] / src / Main / fgviewer.cxx
index 6e6e040b726cc5e0b97ee81aceaa40c7d1eb8f59..b1a399e197daf65fb38c535b7163070817f3aa16 100644 (file)
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <iostream>
 #include <cstdlib>
 
@@ -40,7 +44,8 @@ public:
     {
         try {
             SGSharedPtr<SGPropertyNode> prop = new SGPropertyNode;
-            return simgear::SGModelLib::loadModel(modelPath, prop);
+            return simgear::SGModelLib::loadModel(modelPath,
+                                                  globals->get_props());
         } catch (...) {
             std::cerr << "Error loading \"" << modelPath << "\"" << std::endl;
             return 0;
@@ -67,8 +72,6 @@ static void dumpOut(osg::Node* node)
     char filename[24];
     static int count = 1;
 
-    FGRenderer *renderer = globals->get_renderer();
-
     while (count < 1000) {
         FILE *fp;
         snprintf(filename, 24, "fgviewer-%03d.osg", count++);
@@ -101,6 +104,7 @@ bool GraphDumpHandler::handle(const osgGA::GUIEventAdapter& ea,
     default:
         return false;
     }
+    return false;
 }
 
 void GraphDumpHandler::getUsage(osg::ApplicationUsage& usage) const
@@ -223,6 +227,8 @@ fgviewerMain(int argc, char** argv)
     SGReaderWriterBTGOptions* btgOptions = new SGReaderWriterBTGOptions;
     btgOptions->getDatabasePathList() = filePathList;
     btgOptions->setMatlib(globals->get_matlib());
+    btgOptions->setUseRandomObjects(fgGetBool("/sim/rendering/random-objects", false));
+    btgOptions->setUseRandomVegetation(fgGetBool("/sim/rendering/random-vegetation", false));
 
     // read the scene from the list of file specified command line args.
     osg::ref_ptr<osg::Node> loadedModel;