1 // options.cxx -- class to handle command line options
3 // Written by Curtis Olson, started April 1998.
5 // Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #if defined(FX) && defined(XMESA)
29 bool global_fullscreen = true;
32 #include <simgear/compiler.h>
34 #include <math.h> // rint()
36 #include <stdlib.h> // atof(), atoi()
41 #include <simgear/constants.h>
42 #include <simgear/debug/logstream.hxx>
43 #include <simgear/misc/fgstream.hxx>
45 #include <Include/general.hxx>
46 #include <Cockpit/cockpit.hxx>
47 #include <FDM/flight.hxx>
48 #include <FDM/UIUCModel/uiuc_aircraftdir.h>
50 # include <NetworkOLK/network.h>
52 #include <Time/fg_time.hxx>
55 #include "options.hxx"
58 FG_USING_NAMESPACE(std);
61 extern void fgReshape( int width, int height );
64 atof( const string& str )
68 // -dw- if ::atof is called, then we get an infinite loop
69 return std::atof( str.c_str() );
71 return ::atof( str.c_str() );
76 atoi( const string& str )
79 // -dw- if ::atoi is called, then we get an infinite loop
80 return std::atoi( str.c_str() );
82 return ::atoi( str.c_str() );
87 // Defined the shared options class here
88 fgOPTIONS current_options;
92 fgOPTIONS::fgOPTIONS() :
93 // starting longitude in degrees (west = -)
94 // starting latitude in degrees (south = -)
96 // Default initial position is Globe, AZ (P13)
100 // North of the city of Globe
104 // North of the city of Globe
108 // Near where I used to live in Globe, AZ
112 // 10125 Jewell St. NE
116 // Near KHSP (Hot Springs, VA)
117 // lon(-79.8338964 + 0.01),
118 // lat( 37.9514564 + 0.008),
120 // (SEZ) SEDONA airport
121 // lon(-111.7884614 + 0.01),
122 // lat( 34.8486289 - 0.015),
124 // Jim Brennon's Kingmont Observatory
125 // lon(-121.1131667),
128 // Huaras, Peru (S09d 31.871' W077d 31.498')
132 // Eclipse Watching w73.5 n10 (approx) 18:00 UT
137 // lon(-90.1953055556),
138 // lat( 45.4511388889),
140 // starting altitude in meters (this will be reset to ground level
141 // if it is lower than the terrain
144 // Initial Orientation
145 heading(270.0), // heading (yaw) angle in degress (Psi)
146 roll(0.0), // roll angle in degrees (Phi)
147 pitch(0.424), // pitch angle in degrees (Theta)
149 // Initialize current options velocities to 0.0
150 uBody(0.0), vBody(0.0), wBody(0.0), vkcas(0.0), mach(0.0),
158 control_mode(FG_JOYSTICK),
159 auto_coordination(FG_AUTO_COORD_NOT_SPECIFIED),
167 // Flight Model options
168 flight_model( FGInterface::FG_LARCSIM ),
170 model_hz( NEW_DEFAULT_MODEL_HZ ),
175 fog(FG_FOG_NICEST), // nicest
177 clouds_asl(5000*FEET_TO_METER),
187 view_mode(FG_VIEW_PILOT),
193 units(FG_UNITS_FEET),
201 // set initial values/defaults
202 time_offset_type=FG_TIME_SYS_OFFSET;
203 char* envp = ::getenv( "FG_ROOT" );
205 if ( envp != NULL ) {
206 // fg_root could be anywhere, so default to environmental
207 // variable $FG_ROOT if it is set.
210 // Otherwise, default to a random compiled in location if
211 // $FG_ROOT is not set. This can still be overridden from the
212 // command line or a config file.
215 fg_root = "\\FlightGear";
216 #elif defined( MACOS )
223 airport_id = ""; // default airport id
224 net_id = "Johnney"; // default pilot's name
226 // initialize port config string list
227 channel_options_list.clear();
231 fgOPTIONS::toggle_panel() {
233 FGTime *t = FGTime::cur_time_params;
235 int toggle_pause = t->getPause();
238 t->togglePauseMode();
241 panel_status = false;
242 if ( current_panel != NULL )
243 current_panel->setVisibility(false);
246 if ( current_panel != NULL )
247 current_panel->setVisibility(true);
249 if ( panel_status ) {
252 fov *= (1.0 / 0.4232);
254 // fgReshape( xsize, ysize);
255 fgReshape( current_view.get_winWidth(), current_view.get_winHeight() );
258 t->togglePauseMode();
262 fgOPTIONS::parse_time(const string& time_in) {
263 char *time_str, num[256];
264 double hours, minutes, seconds;
269 time_str = (char *)time_in.c_str();
271 // printf("parse_time(): %s\n", time_str);
274 if ( strlen(time_str) ) {
275 if ( time_str[0] == '+' ) {
278 } else if ( time_str[0] == '-' ) {
283 // printf("sign = %d\n", sign);
286 if ( strlen(time_str) ) {
288 while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
289 num[i] = time_str[0];
293 if ( time_str[0] == ':' ) {
298 // printf("hours = %.2lf\n", hours);
304 if ( strlen(time_str) ) {
306 while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
307 num[i] = time_str[0];
311 if ( time_str[0] == ':' ) {
316 // printf("minutes = %.2lf\n", minutes);
318 result += minutes / 60.0;
322 if ( strlen(time_str) ) {
324 while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
325 num[i] = time_str[0];
331 // printf("seconds = %.2lf\n", seconds);
333 result += seconds / 3600.0;
336 return(sign * result);
340 long int fgOPTIONS::parse_date( const string& date)
343 char * date_str, num[256];
345 // initialize to zero
352 gmt.tm_isdst = 0; // ignore daylight savings time for the moment
353 date_str = (char *)date.c_str();
355 if ( strlen(date_str) ) {
357 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
358 num[i] = date_str[0];
362 if ( date_str[0] == ':' ) {
366 gmt.tm_year = atoi(num) - 1900;
369 if ( strlen(date_str) ) {
371 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
372 num[i] = date_str[0];
376 if ( date_str[0] == ':' ) {
380 gmt.tm_mon = atoi(num) -1;
383 if ( strlen(date_str) ) {
385 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
386 num[i] = date_str[0];
390 if ( date_str[0] == ':' ) {
394 gmt.tm_mday = atoi(num);
397 if ( strlen(date_str) ) {
399 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
400 num[i] = date_str[0];
404 if ( date_str[0] == ':' ) {
408 gmt.tm_hour = atoi(num);
411 if ( strlen(date_str) ) {
413 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
414 num[i] = date_str[0];
418 if ( date_str[0] == ':' ) {
422 gmt.tm_min = atoi(num);
425 if ( strlen(date_str) ) {
427 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
428 num[i] = date_str[0];
432 if ( date_str[0] == ':' ) {
436 gmt.tm_sec = atoi(num);
438 time_t theTime = FGTime::cur_time_params->get_gmt(gmt.tm_year,
444 //printf ("Date is %s\n", ctime(&theTime));
445 //printf ("in seconds that is %d\n", theTime);
451 // parse degree in the form of [+/-]hhh:mm:ss
452 void fgOPTIONS::parse_control( const string& mode ) {
453 if ( mode == "joystick" ) {
454 control_mode = FG_JOYSTICK;
455 } else if ( mode == "mouse" ) {
456 control_mode = FG_MOUSE;
458 control_mode = FG_KEYBOARD;
463 /// parse degree in the form of [+/-]hhh:mm:ss
465 fgOPTIONS::parse_degree( const string& degree_str) {
466 double result = parse_time( degree_str );
468 // printf("Degree = %.4f\n", result);
474 // parse time offset command line option
476 fgOPTIONS::parse_time_offset( const string& time_str) {
479 // printf("time offset = %s\n", time_str);
482 result = (int)rint(parse_time(time_str) * 3600.0);
484 result = (int)(parse_time(time_str) * 3600.0);
487 // printf("parse_time_offset(): %d\n", result);
493 // Parse --tile-diameter=n type option
496 fgOPTIONS::parse_tile_radius( const string& arg ) {
497 int radius = atoi( arg );
499 if ( radius < FG_RADIUS_MIN ) { radius = FG_RADIUS_MIN; }
500 if ( radius > FG_RADIUS_MAX ) { radius = FG_RADIUS_MAX; }
502 // printf("parse_tile_radius(): radius = %d\n", radius);
508 // Parse --fdm=abcdefg type option
510 fgOPTIONS::parse_fdm( const string& fm ) {
511 // cout << "fdm = " << fm << endl;
513 if ( fm == "balloon" ) {
514 return FGInterface::FG_BALLOONSIM;
515 } else if ( fm == "external" ) {
516 return FGInterface::FG_EXTERNAL;
517 } else if ( fm == "jsb" ) {
518 return FGInterface::FG_JSBSIM;
519 } else if ( (fm == "larcsim") || (fm == "LaRCsim") ) {
520 return FGInterface::FG_LARCSIM;
521 } else if ( fm == "magic" ) {
522 return FGInterface::FG_MAGICCARPET;
524 FG_LOG( FG_GENERAL, FG_ALERT, "Unknown fdm = " << fm );
528 // we'll never get here, but it makes the compiler happy.
533 // Parse --fov=x.xx type option
535 fgOPTIONS::parse_fov( const string& arg ) {
536 double fov = atof(arg);
538 if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
539 if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
541 // printf("parse_fov(): result = %.4f\n", fov);
547 // Parse I/O channel option
549 // Format is "--protocol=medium,direction,hz,medium_options,..."
551 // protocol = { native, nmea, garmin, fgfs, rul, pve, etc. }
552 // medium = { serial, socket, file, etc. }
553 // direction = { in, out, bi }
554 // hz = number of times to process channel per second (floating
555 // point values are ok.
557 // Serial example "--nmea=serial,dir,hz,device,baud" where
559 // device = OS device name of serial line to be open()'ed
560 // baud = {300, 1200, 2400, ..., 230400}
562 // Socket exacmple "--native=socket,dir,hz,machine,port" where
564 // machine = machine name or ip address if client (leave empty if server)
565 // port = port, leave empty to let system choose
567 // File example "--garmin=file,dir,hz,filename" where
569 // filename = file system file name
572 fgOPTIONS::parse_channel( const string& type, const string& channel_str ) {
573 // cout << "Channel string = " << channel_str << endl;
575 channel_options_list.push_back( type + "," + channel_str );
581 // Parse a single option
582 int fgOPTIONS::parse_option( const string& arg ) {
584 if ( (arg == "--help") || (arg == "-h") ) {
585 // help/usage request
586 return(FG_OPTIONS_HELP);
587 } else if ( arg == "--disable-game-mode") {
589 } else if ( arg == "--enable-game-mode" ) {
591 } else if ( arg == "--disable-splash-screen" ) {
592 splash_screen = false;
593 } else if ( arg == "--enable-splash-screen" ) {
594 splash_screen = true;
595 } else if ( arg == "--disable-intro-music" ) {
597 } else if ( arg == "--enable-intro-music" ) {
599 } else if ( arg == "--disable-mouse-pointer" ) {
601 } else if ( arg == "--enable-mouse-pointer" ) {
603 } else if ( arg == "--disable-pause" ) {
605 } else if ( arg == "--enable-pause" ) {
607 } else if ( arg == "--disable-anti-alias-hud" ) {
608 anti_alias_hud = false;
609 } else if ( arg == "--enable-anti-alias-hud" ) {
610 anti_alias_hud = true;
611 } else if ( arg.find( "--control=") != string::npos ) {
612 parse_control( arg.substr(10) );
613 } else if ( arg == "--disable-auto-coordination" ) {
614 auto_coordination = FG_AUTO_COORD_DISABLED;
615 } else if ( arg == "--enable-auto-coordination" ) {
616 auto_coordination = FG_AUTO_COORD_ENABLED;
617 } else if ( arg == "--disable-hud" ) {
619 } else if ( arg == "--enable-hud" ) {
621 } else if ( arg == "--disable-panel" ) {
622 panel_status = false;
623 if ( current_panel != NULL )
624 current_panel->setVisibility(false);
625 } else if ( arg == "--enable-panel" ) {
627 if ( current_panel != NULL )
628 current_panel->setVisibility(true);
630 } else if ( arg == "--disable-sound" ) {
632 } else if ( arg == "--enable-sound" ) {
634 } else if ( arg.find( "--airport-id=") != string::npos ) {
635 airport_id = arg.substr( 13 );
636 } else if ( arg.find( "--lon=" ) != string::npos ) {
637 lon = parse_degree( arg.substr(6) );
638 } else if ( arg.find( "--lat=" ) != string::npos ) {
639 lat = parse_degree( arg.substr(6) );
640 } else if ( arg.find( "--altitude=" ) != string::npos ) {
641 if ( units == FG_UNITS_FEET ) {
642 altitude = atof( arg.substr(11) ) * FEET_TO_METER;
644 altitude = atof( arg.substr(11) );
646 } else if ( arg.find( "--uBody=" ) != string::npos ) {
648 if ( units == FG_UNITS_FEET ) {
649 uBody = atof( arg.substr(8) );
651 uBody = atof( arg.substr(8) ) * FEET_TO_METER;
653 } else if ( arg.find( "--vBody=" ) != string::npos ) {
655 if ( units == FG_UNITS_FEET ) {
656 vBody = atof( arg.substr(8) );
658 vBody = atof( arg.substr(8) ) * FEET_TO_METER;
660 } else if ( arg.find( "--wBody=" ) != string::npos ) {
662 if ( units == FG_UNITS_FEET ) {
663 wBody = atof( arg.substr(8) );
665 wBody = atof( arg.substr(8) ) * FEET_TO_METER;
667 } else if ( arg.find( "--vc=" ) != string::npos) {
669 vkcas=atof( arg.substr(5) );
670 cout << "Got vc: " << vkcas << endl;
671 } else if ( arg.find( "--mach=" ) != string::npos) {
673 mach=atof( arg.substr(7) );
674 } else if ( arg.find( "--heading=" ) != string::npos ) {
675 heading = atof( arg.substr(10) );
676 } else if ( arg.find( "--roll=" ) != string::npos ) {
677 roll = atof( arg.substr(7) );
678 } else if ( arg.find( "--pitch=" ) != string::npos ) {
679 pitch = atof( arg.substr(8) );
680 } else if ( arg.find( "--fg-root=" ) != string::npos ) {
681 fg_root = arg.substr( 10 );
682 } else if ( arg.find( "--fdm=" ) != string::npos ) {
683 flight_model = parse_fdm( arg.substr(6) );
684 if((flight_model == FGInterface::FG_JSBSIM) && (get_trim_mode() == 0)) {
689 } else if ( arg.find( "--aircraft=" ) != string::npos ) {
690 aircraft = arg.substr(11);
691 } else if ( arg.find( "--aircraft-dir=" ) != string::npos ) {
692 aircraft_dir = arg.substr(15); // (UIUC)
693 } else if ( arg.find( "--model-hz=" ) != string::npos ) {
694 model_hz = atoi( arg.substr(11) );
695 } else if ( arg.find( "--speed=" ) != string::npos ) {
696 speed_up = atoi( arg.substr(8) );
697 } else if ( arg.find( "--notrim") != string::npos) {
699 } else if ( arg == "--fog-disable" ) {
700 fog = FG_FOG_DISABLED;
701 } else if ( arg == "--fog-fastest" ) {
702 fog = FG_FOG_FASTEST;
703 } else if ( arg == "--fog-nicest" ) {
705 } else if ( arg == "--disable-clouds" ) {
707 } else if ( arg == "--enable-clouds" ) {
709 } else if ( arg.find( "--clouds-asl=" ) != string::npos ) {
710 if ( units == FG_UNITS_FEET ) {
711 clouds_asl = atof( arg.substr(13) ) * FEET_TO_METER;
713 clouds_asl = atof( arg.substr(13) );
715 } else if ( arg.find( "--fov=" ) != string::npos ) {
716 fov = parse_fov( arg.substr(6) );
717 } else if ( arg == "--disable-fullscreen" ) {
719 } else if ( arg== "--enable-fullscreen") {
721 } else if ( arg == "--shading-flat") {
723 } else if ( arg == "--shading-smooth") {
725 } else if ( arg == "--disable-skyblend") {
727 } else if ( arg== "--enable-skyblend" ) {
729 } else if ( arg == "--disable-textures" ) {
731 } else if ( arg == "--enable-textures" ) {
733 } else if ( arg == "--disable-wireframe" ) {
735 } else if ( arg == "--enable-wireframe" ) {
737 } else if ( arg.find( "--geometry=" ) != string::npos ) {
738 bool geometry_ok = true;
739 string geometry = arg.substr( 11 );
740 string::size_type i = geometry.find('x');
742 if (i != string::npos) {
743 xsize = atoi(geometry.substr(0, i));
744 ysize = atoi(geometry.substr(i+1));
745 // cout << "Geometry is " << xsize << 'x' << ysize << '\n';
750 if ( xsize <= 0 || ysize <= 0 ) {
756 if ( !geometry_ok ) {
757 FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry );
758 FG_LOG( FG_GENERAL, FG_ALERT,
759 "Setting geometry to " << xsize << 'x' << ysize << '\n');
761 } else if ( arg.find( "--bpp=" ) != string::npos ) {
762 string bits_per_pix = arg.substr( 6 );
763 if ( bits_per_pix == "16" ) {
765 } else if ( bits_per_pix == "24" ) {
767 } else if ( bits_per_pix == "32" ) {
770 } else if ( arg == "--units-feet" ) {
771 units = FG_UNITS_FEET;
772 } else if ( arg == "--units-meters" ) {
773 units = FG_UNITS_METERS;
774 } else if ( arg.find( "--tile-radius=" ) != string::npos ) {
775 tile_radius = parse_tile_radius( arg.substr(14) );
776 tile_diameter = tile_radius * 2 + 1;
777 } else if ( arg.find( "--time-offset" ) != string::npos ) {
778 time_offset = parse_time_offset( (arg.substr(14)) );
779 //time_offset_type = FG_TIME_SYS_OFFSET;
780 } else if ( arg.find( "--time-match-real") != string::npos ) {
781 //time_offset = parse_time_offset(arg.substr(18));
782 time_offset_type = FG_TIME_SYS_OFFSET;
783 } else if ( arg.find( "--time-match-local") != string::npos ) {
784 //time_offset = parse_time_offset(arg.substr(18));
785 time_offset_type = FG_TIME_LAT_OFFSET;
786 } else if ( arg.find( "--start-date-sys=") != string::npos ) {
787 time_offset = parse_date( (arg.substr(17)) );
788 time_offset_type = FG_TIME_SYS_ABSOLUTE;
789 } else if ( arg.find( "--start-date-lat=") != string::npos ) {
790 time_offset = parse_date( (arg.substr(17)) );
791 time_offset_type = FG_TIME_LAT_ABSOLUTE;
792 } else if ( arg.find( "--start-date-gmt=") != string::npos ) {
793 time_offset = parse_date( (arg.substr(17)) );
794 time_offset_type = FG_TIME_GMT_ABSOLUTE;
796 } else if ( arg == "--hud-tris" ) {
798 } else if ( arg == "--hud-culled" ) {
800 } else if ( arg.find( "--native=" ) != string::npos ) {
801 parse_channel( "native", arg.substr(9) );
802 } else if ( arg.find( "--garmin=" ) != string::npos ) {
803 parse_channel( "garmin", arg.substr(9) );
804 } else if ( arg.find( "--nmea=" ) != string::npos ) {
805 parse_channel( "nmea", arg.substr(7) );
806 } else if ( arg.find( "--pve=" ) != string::npos ) {
807 parse_channel( "pve", arg.substr(6) );
808 } else if ( arg.find( "--ray=" ) != string::npos ) {
809 parse_channel( "ray", arg.substr(6) );
810 } else if ( arg.find( "--rul=" ) != string::npos ) {
811 parse_channel( "rul", arg.substr(6) );
812 } else if ( arg.find( "--joyclient=" ) != string::npos ) {
813 parse_channel( "joyclient", arg.substr(12) );
814 #ifdef FG_NETWORK_OLK
815 } else if ( arg == "--disable-network-olk" ) {
817 } else if ( arg== "--enable-network-olk") {
819 } else if ( arg == "--net-hud" ) {
821 } else if ( arg.find( "--net-id=") != string::npos ) {
822 net_id = arg.substr( 9 );
825 FG_LOG( FG_GENERAL, FG_ALERT, "Unknown option '" << arg << "'" );
826 return FG_OPTIONS_ERROR;
829 return FG_OPTIONS_OK;
833 // Parse the command line options
834 int fgOPTIONS::parse_command_line( int argc, char **argv ) {
838 FG_LOG(FG_GENERAL, FG_INFO, "Processing command line arguments");
841 FG_LOG( FG_GENERAL, FG_DEBUG, "argv[" << i << "] = " << argv[i] );
843 result = parse_option(argv[i]);
844 if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
851 return(FG_OPTIONS_OK);
855 // Parse config file options
856 int fgOPTIONS::parse_config_file( const string& path ) {
857 fg_gzifstream in( path );
859 return(FG_OPTIONS_ERROR);
861 FG_LOG( FG_GENERAL, FG_INFO, "Processing config file: " << path );
865 while ( ! in.eof() ) {
868 while ( in.get(c) && c != '\0' ) {
873 #ifdef GETLINE_NEEDS_TERMINATOR
874 getline( in, line, '\n' );
875 #elif defined (MACOS)
876 getline( in, line, '\r' );
881 if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
882 FG_LOG( FG_GENERAL, FG_ALERT,
883 "Config file parse error: " << path << " '"
890 return FG_OPTIONS_OK;
894 // Print usage message
895 void fgOPTIONS::usage ( void ) {
896 cout << "Usage: fg [ options ... ]" << endl;
899 cout << "General Options:" << endl;
900 cout << "\t--help -h: print usage" << endl;
901 cout << "\t--fg-root=path: specify the root path for all the data files"
903 cout << "\t--disable-game-mode: disable full-screen game mode" << endl;
904 cout << "\t--enable-game-mode: enable full-screen game mode" << endl;
905 cout << "\t--disable-splash-screen: disable splash screen" << endl;
906 cout << "\t--enable-splash-screen: enable splash screen" << endl;
907 cout << "\t--disable-intro-music: disable introduction music" << endl;
908 cout << "\t--enable-intro-music: enable introduction music" << endl;
909 cout << "\t--disable-mouse-pointer: disable extra mouse pointer" << endl;
910 cout << "\t--enable-mouse-pointer: enable extra mouse pointer (i.e. for"
912 cout << "\t\tfull screen voodoo/voodoo-II based cards.)" << endl;
913 cout << "\t--disable-pause: start out in an active state" << endl;
914 cout << "\t--enable-pause: start out in a paused state" << endl;
915 cout << "\t--control=mode: primary control mode "
916 << "(joystick, keyboard, mouse)" << endl;
919 cout << "Features:" << endl;
920 cout << "\t--disable-hud: disable heads up display" << endl;
921 cout << "\t--enable-hud: enable heads up display" << endl;
922 cout << "\t--disable-panel: disable instrument panel" << endl;
923 cout << "\t--enable-panel: enable instrumetn panel" << endl;
924 cout << "\t--disable-sound: disable sound effects" << endl;
925 cout << "\t--enable-sound: enable sound effects" << endl;
926 cout << "\t--disable-anti-alias-hud: disable anti aliased hud" << endl;
927 cout << "\t--enable-anti-alias-hud: enable anti aliased hud" << endl;
930 cout << "Flight Model:" << endl;
931 cout << "\t--fdm=abcd: selects the core flight model code." << endl;
932 cout << "\t\tcan be one of jsb, larcsim, magic, or external" << endl;
933 cout << "\t--aircraft=abcd: aircraft model to load" << endl;
934 cout << "\t--model-hz=n: run the FDM this rate (iterations per second)"
936 cout << "\t--speed=n: run the FDM this much faster than real time" << endl;
937 cout << "\t--notrim: Do NOT attempt to trim the model when initializing JSBsim" << endl;
940 cout <<"Aircraft model directory" << endl;
941 cout <<"\t--aircraft-dir=<path> path is relative to the path of the executable" << endl;
944 cout << "Initial Position and Orientation:" << endl;
945 cout << "\t--airport-id=ABCD: specify starting postion by airport id"
947 cout << "\t--lon=degrees: starting longitude in degrees (west = -)"
949 cout << "\t--lat=degrees: starting latitude in degrees (south = -)"
951 cout << "\t--altitude=feet: starting altitude in feet" << endl;
952 cout << "\t\t(unless --units-meters specified" << endl;
953 cout << "\t--heading=degrees: heading (yaw) angle in degress (Psi)"
955 cout << "\t--roll=degrees: roll angle in degrees (Phi)" << endl;
956 cout << "\t--pitch=degrees: pitch angle in degrees (Theta)" << endl;
957 cout << "\t--uBody=feet per second: velocity along the body X axis"
959 cout << "\t--vBody=feet per second: velocity along the body Y axis"
961 cout << "\t--wBody=feet per second: velocity along the body Z axis"
963 cout << "\t\t(unless --units-meters specified" << endl;
964 cout << "\t--vc= initial airspeed in knots (--fdm=jsb only)" << endl;
965 cout << "\t--mach= initial mach number (--fdm=jsb only)" << endl;
968 cout << "Rendering Options:" << endl;
969 cout << "\t--fog-disable: disable fog/haze" << endl;
970 cout << "\t--fog-fastest: enable fastest fog/haze" << endl;
971 cout << "\t--fog-nicest: enable nicest fog/haze" << endl;
972 cout << "\t--enable-clouds: enable demo cloud layer" << endl;
973 cout << "\t--disable-clouds: disable demo cloud layer" << endl;
974 cout << "\t--clouds-asl=xxx: specify altitude of cloud layer above sea level" << endl;
975 cout << "\t--fov=xx.x: specify initial field of view angle in degrees"
977 cout << "\t--disable-fullscreen: disable fullscreen mode" << endl;
978 cout << "\t--enable-fullscreen: enable fullscreen mode" << endl;
979 cout << "\t--shading-flat: enable flat shading" << endl;
980 cout << "\t--shading-smooth: enable smooth shading" << endl;
981 cout << "\t--disable-skyblend: disable sky blending" << endl;
982 cout << "\t--enable-skyblend: enable sky blending" << endl;
983 cout << "\t--disable-textures: disable textures" << endl;
984 cout << "\t--enable-textures: enable textures" << endl;
985 cout << "\t--disable-wireframe: disable wireframe drawing mode" << endl;
986 cout << "\t--enable-wireframe: enable wireframe drawing mode" << endl;
987 cout << "\t--geometry=WWWxHHH: window geometry: 640x480, 800x600, etc."
991 cout << "Scenery Options:" << endl;
992 cout << "\t--tile-radius=n: specify tile radius, must be 1 - 4" << endl;
995 cout << "Hud Options:" << endl;
996 cout << "\t--units-feet: Hud displays units in feet" << endl;
997 cout << "\t--units-meters: Hud displays units in meters" << endl;
998 cout << "\t--hud-tris: Hud displays number of triangles rendered" << endl;
999 cout << "\t--hud-culled: Hud displays percentage of triangles culled"
1003 cout << "Time Options:" << endl;
1004 cout << "\t--time-offset=[+-]hh:mm:ss: add this time offset" << endl;
1005 cout << "\t--time-match-real: Synchronize real-world and FlightGear" << endl
1006 << "\t\ttime. Can be used in combination with --time-offset." << endl;
1007 cout << "\t--time-match-local:Synchronize local real-world and " << endl
1008 << "\t\tFlightGear time" << endl;
1009 cout << "\t--start-date-sys=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1010 << "\t\tdate/time. Uses your system time " << endl;
1011 cout << "\t--start-date-gmt=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1012 << "\t\tdate/time. Uses Greenwich Mean Time" << endl;
1013 cout << "\t--start-date-lat=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1014 << "\t\tdate/time. Uses Local Aircraft Time" << endl;
1015 #ifdef FG_NETWORK_OLK
1018 cout << "Network Options:" << endl;
1019 cout << "\t--net-hud: Hud displays network info" << endl;
1020 cout << "\t--net-id=name: specify your own callsign" << endl;
1026 fgOPTIONS::~fgOPTIONS( void ) {