X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Foptions.cxx;h=11b5e7c0bd8f1cbe77eecc1c8b7f1b19fc31df0a;hb=2f2d14a41f7582555724396f21f0ab04d73e1bda;hp=9e9979c951ab510240bf6fcbb150b8f5d4ee40f0;hpb=c6f0d87a26b869aeda38e3734f3ef41a63c52183;p=flightgear.git diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 9e9979c95..11b5e7c0b 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -597,6 +597,8 @@ clearLocation () fgSetString("/sim/presets/airport-id", ""); fgSetString("/sim/presets/vor-id", ""); fgSetString("/sim/presets/ndb-id", ""); + fgSetString("/sim/presets/carrier", ""); + fgSetString("/sim/presets/parkpos", ""); fgSetString("/sim/presets/fix", ""); } @@ -616,6 +618,21 @@ fgOptNDB( const char * arg ) return FG_OPTIONS_OK; } +static int +fgOptCarrier( const char * arg ) +{ + clearLocation(); + fgSetString("/sim/presets/carrier", arg); + return FG_OPTIONS_OK; +} + +static int +fgOptParkpos( const char * arg ) +{ + fgSetString("/sim/presets/parkpos", arg); + return FG_OPTIONS_OK; +} + static int fgOptFIX( const char * arg ) { @@ -1215,6 +1232,8 @@ struct OptionDesc { {"runway", true, OPTION_STRING, "/sim/presets/runway", false, "", 0 }, {"vor", true, OPTION_FUNC, "", false, "", fgOptVOR }, {"ndb", true, OPTION_FUNC, "", false, "", fgOptNDB }, + {"carrier", true, OPTION_FUNC, "", false, "", fgOptCarrier }, + {"parkpos", true, OPTION_FUNC, "", false, "", fgOptParkpos }, {"fix", true, OPTION_FUNC, "", false, "", fgOptFIX }, {"offset-distance", true, OPTION_DOUBLE, "/sim/presets/offset-distance", false, "", 0 }, {"offset-azimuth", true, OPTION_DOUBLE, "/sim/presets/offset-azimuth", false, "", 0 }, @@ -1258,11 +1277,10 @@ struct OptionDesc { {"enable-specular-highlight", false, OPTION_BOOL, "/sim/rendering/specular-highlight", true, "", 0 }, {"disable-clouds", false, OPTION_BOOL, "/environment/clouds/status", false, "", 0 }, {"enable-clouds", false, OPTION_BOOL, "/environment/clouds/status", true, "", 0 }, -#ifdef FG_USE_CLOUDS_3D - {"disable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d", false, "", 0 }, - {"enable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d", true, "", 0 }, -#endif + {"disable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d-enable", false, "", 0 }, + {"enable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d-enable", true, "", 0 }, {"fov", true, OPTION_FUNC, "", false, "", fgOptFov }, + {"aspect-ratio-multiplier", true, OPTION_DOUBLE, "/sim/current-view/aspect-ratio-multiplier", false, "", 0 }, {"disable-fullscreen", false, OPTION_BOOL, "/sim/startup/fullscreen", false, "", 0 }, {"enable-fullscreen", false, OPTION_BOOL, "/sim/startup/fullscreen", true, "", 0 }, {"shading-flat", false, OPTION_BOOL, "/sim/rendering/shading", false, "", 0 }, @@ -1534,9 +1552,11 @@ fgParseOptions (const string& path) { #endif // catch extraneous (DOS) line ending character - if ( line[line.length() - 1] < 32 ) { - line = line.substr( 0, line.length()-1 ); - } + int i; + for (i = line.length(); i > 0; i--) + if (line[i - 1] > 32) + break; + line = line.substr( 0, i ); if ( parse_option( line ) == FG_OPTIONS_ERROR ) { cerr << endl << "Config file parse error: " << path << " '" @@ -1707,7 +1727,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); }