X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FMain%2Foptions.cxx;h=ad17068e682f48494c07c76a0aa5a11ab0b83697;hb=0c8c8380b1037ca52725e4703cf87ffb6aee77eb;hp=fbe82388c422b61acdef23864a2c7baed5a44727;hpb=8e1248e1e14bbce203e8d60c67c9887b0683e3d5;p=flightgear.git diff --git a/src/Main/options.cxx b/src/Main/options.cxx index fbe82388c..ad17068e6 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -60,7 +60,7 @@ #include "options.hxx" #include "util.hxx" #include "viewmgr.hxx" - +#include
using std::string; using std::sort; @@ -586,15 +586,6 @@ fgOptLanguage( const char *arg ) return FG_OPTIONS_OK; } -static int -fgOptWeather( const char *arg ) -{ - if (arg[0]) - fgSetString("/environment/weather-scenario", arg); - fgSetBool("/environment/params/real-world-weather-fetch", !strcmp(arg, "METAR")); - return FG_OPTIONS_OK; -} - static void clearLocation () { @@ -1005,7 +996,7 @@ fgOptRandomWind( const char *arg ) static int fgOptWind( const char *arg ) { - double min_hdg, max_hdg, speed, gust; + double min_hdg = 0.0, max_hdg = 0.0, speed = 0.0, gust = 0.0; if (!parse_wind( arg, &min_hdg, &max_hdg, &speed, &gust)) { SG_LOG( SG_GENERAL, SG_ALERT, "bad wind value " << arg ); return FG_OPTIONS_ERROR; @@ -1213,8 +1204,18 @@ static int fgOptFpe(const char* arg) { // Actually handled in bootstrap.cxx + return FG_OPTIONS_OK; } +static int +fgOptFgviewer(const char* arg) +{ + // Actually handled in bootstrap.cxx + return FG_OPTIONS_OK; +} + + + static map fgOptionMap; /* @@ -1266,8 +1267,9 @@ struct OptionDesc { {"enable-mouse-pointer", false, OPTION_STRING, "/sim/startup/mouse-pointer", false, "enabled", 0 }, {"disable-random-objects", false, OPTION_BOOL, "/sim/rendering/random-objects", false, "", 0 }, {"enable-random-objects", false, OPTION_BOOL, "/sim/rendering/random-objects", true, "", 0 }, - {"disable-real-weather-fetch", false, OPTION_FUNC, "", false, "", fgOptWeather }, - {"enable-real-weather-fetch", false, OPTION_FUNC, "", false, "METAR", fgOptWeather }, + {"disable-real-weather-fetch", false, OPTION_BOOL, "/environment/params/real-world-weather-fetch", false, "", 0 }, + {"enable-real-weather-fetch", false, OPTION_BOOL, "/environment/params/real-world-weather-fetch", true, "", 0 }, + {"metar", true, OPTION_STRING, "/environment/metar/data", false, "", 0 }, {"disable-ai-models", false, OPTION_BOOL, "/sim/ai/enabled", false, "", 0 }, {"enable-ai-models", false, OPTION_BOOL, "/sim/ai/enabled", true, "", 0 }, {"disable-freeze", false, OPTION_BOOL, "/sim/freeze/master", false, "", 0 }, @@ -1424,6 +1426,7 @@ struct OptionDesc { {"parking-id", true, OPTION_FUNC, "", false, "", fgOptParking }, {"version", false, OPTION_FUNC, "", false, "", fgOptVersion }, {"enable-fpe", false, OPTION_FUNC, "", false, "", fgOptFpe}, + {"fgviewer", false, OPTION_FUNC, "", false, "", fgOptFgviewer}, {0} }; @@ -1812,9 +1815,9 @@ unsigned int getNumMaturity(const char * str) { // changes should also be reflected in $FG_ROOT/data/options.xml & // $FG_ROOT/data/Translations/string-default.xml - const char levels[][20]= {"alpha","beta","early-production","production",0}; + const char* levels[] = {"alpha","beta","early-production","production"}; - for (unsigned int i=0; i<(sizeof(levels)/sizeof(levels[0])-1);i++) + for (size_t i=0; i<(sizeof(levels)/sizeof(levels[0]));i++) if (strcmp(str,levels[i])==0) return i;