]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/options.cxx
Fixed --enable-freeze.
[flightgear.git] / src / Main / options.cxx
index 6b30f62ac55587d2d5121bc9812e35820d5d8c13..1073c5635472bf8ffa5ede6c2b1f25ffdbe52eb9 100644 (file)
@@ -149,6 +149,7 @@ fgSetDefaults ()
     fgSetInt("/sim/model-hz", NEW_DEFAULT_MODEL_HZ);
     fgSetInt("/sim/speed-up", 1);
     fgSetBool("/sim/startup/trim", false);
+    fgSetBool("/sim/startup/onground", true);
 
                                // Rendering options
     fgSetString("/sim/rendering/fog", "nicest");
@@ -440,7 +441,7 @@ static bool
 parse_channel( const string& type, const string& channel_str ) {
     // cout << "Channel string = " << channel_str << endl;
 
-    globals->get_channel_options_list().push_back( type + "," + channel_str );
+    globals->get_channel_options_list()->push_back( type + "," + channel_str );
 
     return true;
 }
@@ -529,9 +530,9 @@ parse_option (const string& arg)
     } else if ( arg == "--enable-mouse-pointer" ) {
        fgSetString("/sim/startup/mouse-pointer", "enabled");
     } else if ( arg == "--disable-freeze" ) {
-       fgSetBool("/sim/freeze", false);
+        globals->set_freeze(false);
     } else if ( arg == "--enable-freeze" ) {
-       fgSetBool("/sim/freeze", true);
+        globals->set_freeze(true);
     } else if ( arg == "--disable-anti-alias-hud" ) {
        fgSetBool("/sim/hud/antialiased", false);
     } else if ( arg == "--enable-anti-alias-hud" ) {
@@ -560,12 +561,13 @@ parse_option (const string& arg)
     } else if ( arg.find( "--lon=" ) != string::npos ) {
        fgSetDouble("/position/longitude",
                              parse_degree(arg.substr(6)));
-       fgSetString("/position/airport-id", "");
+       fgSetString("/sim/startup/airport-id", "");
     } else if ( arg.find( "--lat=" ) != string::npos ) {
        fgSetDouble("/position/latitude",
                              parse_degree(arg.substr(6)));
-       fgSetString("/position/airport-id", "");
+       fgSetString("/sim/startup/airport-id", "");
     } else if ( arg.find( "--altitude=" ) != string::npos ) {
+       fgSetBool("/sim/startup/onground", false);
        if ( fgGetString("/sim/startup/units") == "feet" )
            fgSetDouble("/position/altitude", atof(arg.substr(11)));
        else
@@ -646,9 +648,13 @@ parse_option (const string& arg)
     } else if ( arg.find( "--speed=" ) != string::npos ) {
        fgSetInt("/sim/speed-up", atoi(arg.substr(8)));
     } else if ( arg.find( "--trim") != string::npos) {
-        fgSetInt("/sim/startup/trim", true);
+        fgSetBool("/sim/startup/trim", true);
     } else if ( arg.find( "--notrim") != string::npos) {
-        fgSetInt("/sim/startup/trim", false);
+        fgSetBool("/sim/startup/trim", false);
+    } else if ( arg.find( "--on-ground") != string::npos) {
+        fgSetBool("/sim/startup/onground", true);
+    } else if ( arg.find( "--in-air") != string::npos) {
+        fgSetBool("/sim/startup/onground", false);
     } else if ( arg == "--fog-disable" ) {
        fgSetString("/sim/rendering/fog", "disabled");
     } else if ( arg == "--fog-fastest" ) {
@@ -796,8 +802,8 @@ parse_option (const string& arg)
        string name = assign.substr(0, pos);
        string value = assign.substr(pos + 1);
        fgSetString(name.c_str(), value);
-       FG_LOG(FG_GENERAL, FG_INFO, "Setting default value of property "
-              << name << " to \"" << value << '"');
+       // FG_LOG(FG_GENERAL, FG_INFO, "Setting default value of property "
+       //        << name << " to \"" << value << '"');
     // $$$ begin - added VS Renganathan, 14 Oct 2K
     // for multi-window outside window imagery
     } else if ( arg.find( "--view-offset=" ) != string::npos ) {
@@ -1031,6 +1037,9 @@ fgUsage ()
         << endl;
     cout << "\t--speed=n:  run the FDM this much faster than real time" << endl;
     cout << "\t--notrim:  Do NOT attempt to trim the model when initializing JSBsim" << endl;
+    cout << "\t--on-ground:  Start up at ground level (default)" << endl;
+    cout << "\t--in-air:  Start up in air (implied by specifying an initial"
+        << " altitude above ground level." << endl;
     cout << "\t--wind=DIR@SPEED: specify wind coming from DIR (degrees) at SPEED (knots)" << endl;
     cout << endl;