]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/options.cxx
UIUC flight model contribution. This is based on LaRCsim, but can read
[flightgear.git] / src / Main / options.cxx
index 41bc4c33b1017765a0eadadb84c717248c7ddb80..11951ed088f5ec29153ece6df74af1a90af15734 100644 (file)
@@ -29,7 +29,7 @@
 bool global_fullscreen = true;
 #endif
 
-#include <Include/compiler.h>
+#include <simgear/compiler.h>
 
 #include <math.h>            // rint()
 #include <stdio.h>
@@ -38,17 +38,20 @@ bool global_fullscreen = true;
 
 #include STL_STRING
 
-#include <Debug/logstream.hxx>
-#include <Misc/fgstream.hxx>
-#include <Include/fg_constants.h>
+#include <simgear/constants.h>
+#include <simgear/debug/logstream.hxx>
+#include <simgear/misc/fgstream.hxx>
+
 #include <Include/general.hxx>
 #include <Cockpit/cockpit.hxx>
 #include <FDM/flight.hxx>
+#include <FDM/UIUCModel/uiuc_aircraftdir.h>
 #ifdef FG_NETWORK_OLK
 #  include <NetworkOLK/network.h>
 #endif
 #include <Time/fg_time.hxx>
 
+#include "views.hxx"
 #include "options.hxx"
 
 FG_USING_STD(string);
@@ -80,6 +83,7 @@ atoi( const string& str )
 #endif
 }
 
+
 // Defined the shared options class here
 fgOPTIONS current_options;
 
@@ -187,8 +191,12 @@ fgOPTIONS::fgOPTIONS() :
     tris_or_culled(0),
        
     // Time options
-    time_offset(0)
+    time_offset(0),
+
+    network_olk(false)
 {
+    aircraft_dir=""; // Initialize the Aircraft directory to "" (UIUC)
+
     // set initial values/defaults
     time_offset_type=FG_TIME_SYS_OFFSET;
     char* envp = ::getenv( "FG_ROOT" );
@@ -653,6 +661,8 @@ int fgOPTIONS::parse_option( const string& arg ) {
        flight_model = parse_fdm( arg.substr(6) );
     } else if ( arg.find( "--aircraft=" ) != string::npos ) {
        aircraft = arg.substr(11);
+    } else if ( arg.find( "--aircraft-dir=" ) != string::npos ) {
+       aircraft_dir =  arg.substr(15); //  (UIUC)
     } else if ( arg.find( "--model-hz=" ) != string::npos ) {
        model_hz = atoi( arg.substr(11) );
     } else if ( arg.find( "--speed=" ) != string::npos ) {
@@ -760,6 +770,10 @@ int fgOPTIONS::parse_option( const string& arg ) {
     } else if ( arg.find( "--rul=" ) != string::npos ) {
        parse_channel( "rul", arg.substr(6) );
 #ifdef FG_NETWORK_OLK
+    } else if ( arg == "--disable-network-olk" ) {
+       network_olk = false;    
+    } else if ( arg== "--enable-network-olk") {
+       network_olk = true;     
     } else if ( arg == "--net-hud" ) {
        net_hud_display = 1;    
     } else if ( arg.find( "--net-id=") != string::npos ) {
@@ -815,9 +829,11 @@ int fgOPTIONS::parse_config_file( const string& path ) {
        string line;
 
 #ifdef GETLINE_NEEDS_TERMINATOR
-       getline( in, line, '\n' );
+        getline( in, line, '\n' );
+#elif defined (MACOS)
+       getline( in, line, '\r' );
 #else
-       getline( in, line );
+        getline( in, line );
 #endif
 
        if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
@@ -875,6 +891,10 @@ void fgOPTIONS::usage ( void ) {
         << endl;
     cout << "\t--speed=n:  run the FDM this much faster than real time" << endl;
     cout << endl;
+    //(UIUC)
+    cout <<"Aircraft model directory" << endl;
+    cout <<"\t--aircraft-dir=<path> path is relative to the path of the executable" << endl;
+    cout << endl;
 
     cout << "Initial Position and Orientation:" << endl;
     cout << "\t--airport-id=ABCD:  specify starting postion by airport id"