]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/options.cxx
In the process of changing, adding and removing files the last few years
[flightgear.git] / src / Main / options.cxx
index f49c5bf68190ba4c657bc9c8d1be5c4eca37f6cf..24bac915245900cfa6bd4e3b4c34a8f2a053ee6d 100644 (file)
@@ -47,7 +47,6 @@
 // #include <Airports/simple.hxx>
 // #include <Cockpit/cockpit.hxx>
 // #include <FDM/flight.hxx>
-// #include <FDM/UIUCModel/uiuc_aircraftdir.h>
 
 #include <Autopilot/route_mgr.hxx>
 #include <GUI/gui.h>
@@ -1152,6 +1151,15 @@ fgOptDME( const char *arg )
     return FG_OPTIONS_OK;
 }
 
+static int
+fgOptLivery( const char *arg )
+{
+    string opt = arg;
+    string livery_path = "livery/" + opt;
+    fgSetString("/sim/model/texture-path", livery_path.c_str() );
+    return FG_OPTIONS_OK;
+}
+
 static map<string,size_t> fgOptionMap;
 
 /*
@@ -1352,6 +1360,7 @@ struct OptionDesc {
     {"adf",                          true,  OPTION_FUNC,   "", false, "", fgOptADF },
     {"dme",                          true,  OPTION_FUNC,   "", false, "", fgOptDME },
     {"min-status",                   true,  OPTION_STRING,  "/sim/aircraft-min-status", false, "all", 0 },
+    {"livery",                       true,  OPTION_FUNC,   "", false, "", fgOptLivery },
     {0}
 };
 
@@ -1727,7 +1736,7 @@ static void fgSearchAircraft(const SGPath &path, string_list &aircraft,
    ulDirEnt* dire;
    ulDir *dirp = ulOpenDir(path.str().c_str());
    if (dirp == NULL) {
-      cerr << "Unable to open aircraft directory." << endl;
+      cerr << "Unable to open aircraft directory '" << path.str() << '\'' << endl;
       exit(-1);
    }