]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fgviewer.cxx
Refactor SGSky handling and ownership - sink into Renderer, remove global variable...
[flightgear.git] / src / Main / fgviewer.cxx
index 6568368050c2f5a9b94128e1b048bfaa571e3a0c..e7f46005b5e819bec44e63cae6db9fee4af18632 100644 (file)
@@ -188,7 +188,6 @@ fgviewerMain(int argc, char** argv)
 
     globals = new FGGlobals;
 
-    fgInitFGRoot(arguments.argc(), arguments.argv());
     if ( !fgInitConfig(arguments.argc(), arguments.argv()) ) {
         SG_LOG( SG_GENERAL, SG_ALERT, "Config option parsing failed ..." );
         exit(-1);
@@ -209,10 +208,11 @@ fgviewerMain(int argc, char** argv)
     // Initialize the material property subsystem.
 
     SGPath mpath( globals->get_fg_root() );
-    mpath.append( "materials.xml" );
+    mpath.append( fgGetString("/sim/rendering/materials-file") );
     if ( ! globals->get_matlib()->load(globals->get_fg_root(), mpath.str(),
             globals->get_props()) ) {
-        SG_LOG( SG_GENERAL, SG_ALERT, "Error loading material lib!" );
+        SG_LOG( SG_GENERAL, SG_ALERT,
+                "Error loading materials file " << mpath.str() );
         exit(-1);
     }