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),
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 ),
174 fog(FG_FOG_NICEST), // nicest
176 clouds_asl(5000*FEET_TO_METER),
186 view_mode(FG_VIEW_PILOT),
192 units(FG_UNITS_FEET),
200 // set initial values/defaults
201 time_offset_type=FG_TIME_SYS_OFFSET;
202 char* envp = ::getenv( "FG_ROOT" );
204 if ( envp != NULL ) {
205 // fg_root could be anywhere, so default to environmental
206 // variable $FG_ROOT if it is set.
209 // Otherwise, default to a random compiled in location if
210 // $FG_ROOT is not set. This can still be overridden from the
211 // command line or a config file.
214 fg_root = "\\FlightGear";
215 #elif defined( MACOS )
222 airport_id = ""; // default airport id
223 net_id = "Johnney"; // default pilot's name
225 // initialize port config string list
226 channel_options_list.clear();
230 fgOPTIONS::toggle_panel() {
232 FGTime *t = FGTime::cur_time_params;
234 int toggle_pause = t->getPause();
237 t->togglePauseMode();
240 panel_status = false;
241 if ( current_panel != NULL )
242 current_panel->setVisibility(false);
245 if ( current_panel != NULL )
246 current_panel->setVisibility(true);
248 if ( panel_status ) {
251 fov *= (1.0 / 0.4232);
253 // fgReshape( xsize, ysize);
254 fgReshape( current_view.get_winWidth(), current_view.get_winHeight() );
257 t->togglePauseMode();
261 fgOPTIONS::parse_time(const string& time_in) {
262 char *time_str, num[256];
263 double hours, minutes, seconds;
268 time_str = (char *)time_in.c_str();
270 // printf("parse_time(): %s\n", time_str);
273 if ( strlen(time_str) ) {
274 if ( time_str[0] == '+' ) {
277 } else if ( time_str[0] == '-' ) {
282 // printf("sign = %d\n", sign);
285 if ( strlen(time_str) ) {
287 while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
288 num[i] = time_str[0];
292 if ( time_str[0] == ':' ) {
297 // printf("hours = %.2lf\n", hours);
303 if ( strlen(time_str) ) {
305 while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
306 num[i] = time_str[0];
310 if ( time_str[0] == ':' ) {
315 // printf("minutes = %.2lf\n", minutes);
317 result += minutes / 60.0;
321 if ( strlen(time_str) ) {
323 while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
324 num[i] = time_str[0];
330 // printf("seconds = %.2lf\n", seconds);
332 result += seconds / 3600.0;
335 return(sign * result);
339 long int fgOPTIONS::parse_date( const string& date)
342 char * date_str, num[256];
344 // initialize to zero
351 gmt.tm_isdst = 0; // ignore daylight savings time for the moment
352 date_str = (char *)date.c_str();
354 if ( strlen(date_str) ) {
356 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
357 num[i] = date_str[0];
361 if ( date_str[0] == ':' ) {
365 gmt.tm_year = atoi(num) - 1900;
368 if ( strlen(date_str) ) {
370 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
371 num[i] = date_str[0];
375 if ( date_str[0] == ':' ) {
379 gmt.tm_mon = atoi(num) -1;
382 if ( strlen(date_str) ) {
384 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
385 num[i] = date_str[0];
389 if ( date_str[0] == ':' ) {
393 gmt.tm_mday = atoi(num);
396 if ( strlen(date_str) ) {
398 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
399 num[i] = date_str[0];
403 if ( date_str[0] == ':' ) {
407 gmt.tm_hour = atoi(num);
410 if ( strlen(date_str) ) {
412 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
413 num[i] = date_str[0];
417 if ( date_str[0] == ':' ) {
421 gmt.tm_min = atoi(num);
424 if ( strlen(date_str) ) {
426 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
427 num[i] = date_str[0];
431 if ( date_str[0] == ':' ) {
435 gmt.tm_sec = atoi(num);
437 time_t theTime = FGTime::cur_time_params->get_gmt(gmt.tm_year,
443 //printf ("Date is %s\n", ctime(&theTime));
444 //printf ("in seconds that is %d\n", theTime);
450 // parse degree in the form of [+/-]hhh:mm:ss
451 void fgOPTIONS::parse_control( const string& mode ) {
452 if ( mode == "joystick" ) {
453 control_mode = FG_JOYSTICK;
454 } else if ( mode == "mouse" ) {
455 control_mode = FG_MOUSE;
457 control_mode = FG_KEYBOARD;
462 /// parse degree in the form of [+/-]hhh:mm:ss
464 fgOPTIONS::parse_degree( const string& degree_str) {
465 double result = parse_time( degree_str );
467 // printf("Degree = %.4f\n", result);
473 // parse time offset command line option
475 fgOPTIONS::parse_time_offset( const string& time_str) {
478 // printf("time offset = %s\n", time_str);
481 result = (int)rint(parse_time(time_str) * 3600.0);
483 result = (int)(parse_time(time_str) * 3600.0);
486 // printf("parse_time_offset(): %d\n", result);
492 // Parse --tile-diameter=n type option
495 fgOPTIONS::parse_tile_radius( const string& arg ) {
496 int radius = atoi( arg );
498 if ( radius < FG_RADIUS_MIN ) { radius = FG_RADIUS_MIN; }
499 if ( radius > FG_RADIUS_MAX ) { radius = FG_RADIUS_MAX; }
501 // printf("parse_tile_radius(): radius = %d\n", radius);
507 // Parse --fdm=abcdefg type option
509 fgOPTIONS::parse_fdm( const string& fm ) {
510 // cout << "fdm = " << fm << endl;
512 if ( fm == "balloon" ) {
513 return FGInterface::FG_BALLOONSIM;
514 } else if ( fm == "external" ) {
515 return FGInterface::FG_EXTERNAL;
516 } else if ( fm == "jsb" ) {
517 return FGInterface::FG_JSBSIM;
518 } else if ( (fm == "larcsim") || (fm == "LaRCsim") ) {
519 return FGInterface::FG_LARCSIM;
520 } else if ( fm == "magic" ) {
521 return FGInterface::FG_MAGICCARPET;
523 FG_LOG( FG_GENERAL, FG_ALERT, "Unknown fdm = " << fm );
527 // we'll never get here, but it makes the compiler happy.
532 // Parse --fov=x.xx type option
534 fgOPTIONS::parse_fov( const string& arg ) {
535 double fov = atof(arg);
537 if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
538 if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
540 // printf("parse_fov(): result = %.4f\n", fov);
546 // Parse I/O channel option
548 // Format is "--protocol=medium,direction,hz,medium_options,..."
550 // protocol = { native, nmea, garmin, fgfs, rul, pve, etc. }
551 // medium = { serial, socket, file, etc. }
552 // direction = { in, out, bi }
553 // hz = number of times to process channel per second (floating
554 // point values are ok.
556 // Serial example "--nmea=serial,dir,hz,device,baud" where
558 // device = OS device name of serial line to be open()'ed
559 // baud = {300, 1200, 2400, ..., 230400}
561 // Socket exacmple "--native=socket,dir,hz,machine,port" where
563 // machine = machine name or ip address if client (leave empty if server)
564 // port = port, leave empty to let system choose
566 // File example "--garmin=file,dir,hz,filename" where
568 // filename = file system file name
571 fgOPTIONS::parse_channel( const string& type, const string& channel_str ) {
572 // cout << "Channel string = " << channel_str << endl;
574 channel_options_list.push_back( type + "," + channel_str );
580 // Parse a single option
581 int fgOPTIONS::parse_option( const string& arg ) {
583 if ( (arg == "--help") || (arg == "-h") ) {
584 // help/usage request
585 return(FG_OPTIONS_HELP);
586 } else if ( arg == "--disable-game-mode") {
588 } else if ( arg == "--enable-game-mode" ) {
590 } else if ( arg == "--disable-splash-screen" ) {
591 splash_screen = false;
592 } else if ( arg == "--enable-splash-screen" ) {
593 splash_screen = true;
594 } else if ( arg == "--disable-intro-music" ) {
596 } else if ( arg == "--enable-intro-music" ) {
598 } else if ( arg == "--disable-mouse-pointer" ) {
600 } else if ( arg == "--enable-mouse-pointer" ) {
602 } else if ( arg == "--disable-pause" ) {
604 } else if ( arg == "--enable-pause" ) {
606 } else if ( arg == "--disable-anti-alias-hud" ) {
607 anti_alias_hud = false;
608 } else if ( arg == "--enable-anti-alias-hud" ) {
609 anti_alias_hud = true;
610 } else if ( arg.find( "--control=") != string::npos ) {
611 parse_control( arg.substr(10) );
612 } else if ( arg == "--disable-auto-coordination" ) {
613 auto_coordination = FG_AUTO_COORD_DISABLED;
614 } else if ( arg == "--enable-auto-coordination" ) {
615 auto_coordination = FG_AUTO_COORD_ENABLED;
616 } else if ( arg == "--disable-hud" ) {
618 } else if ( arg == "--enable-hud" ) {
620 } else if ( arg == "--disable-panel" ) {
621 panel_status = false;
622 if ( current_panel != NULL )
623 current_panel->setVisibility(false);
624 } else if ( arg == "--enable-panel" ) {
626 if ( current_panel != NULL )
627 current_panel->setVisibility(true);
629 } else if ( arg == "--disable-sound" ) {
631 } else if ( arg == "--enable-sound" ) {
633 } else if ( arg.find( "--airport-id=") != string::npos ) {
634 airport_id = arg.substr( 13 );
635 } else if ( arg.find( "--lon=" ) != string::npos ) {
636 lon = parse_degree( arg.substr(6) );
637 } else if ( arg.find( "--lat=" ) != string::npos ) {
638 lat = parse_degree( arg.substr(6) );
639 } else if ( arg.find( "--altitude=" ) != string::npos ) {
640 if ( units == FG_UNITS_FEET ) {
641 altitude = atof( arg.substr(11) ) * FEET_TO_METER;
643 altitude = atof( arg.substr(11) );
645 } else if ( arg.find( "--uBody=" ) != string::npos ) {
646 if ( units == FG_UNITS_FEET ) {
647 uBody = atof( arg.substr(8) );
649 uBody = atof( arg.substr(8) ) * FEET_TO_METER;
651 } else if ( arg.find( "--vBody=" ) != string::npos ) {
652 if ( units == FG_UNITS_FEET ) {
653 vBody = atof( arg.substr(8) );
655 vBody = atof( arg.substr(8) ) * FEET_TO_METER;
657 } else if ( arg.find( "--wBody=" ) != string::npos ) {
658 if ( units == FG_UNITS_FEET ) {
659 wBody = atof( arg.substr(8) );
661 wBody = atof( arg.substr(8) ) * FEET_TO_METER;
663 } else if ( arg.find( "--heading=" ) != string::npos ) {
664 heading = atof( arg.substr(10) );
665 } else if ( arg.find( "--roll=" ) != string::npos ) {
666 roll = atof( arg.substr(7) );
667 } else if ( arg.find( "--pitch=" ) != string::npos ) {
668 pitch = atof( arg.substr(8) );
669 } else if ( arg.find( "--fg-root=" ) != string::npos ) {
670 fg_root = arg.substr( 10 );
671 } else if ( arg.find( "--fdm=" ) != string::npos ) {
672 flight_model = parse_fdm( arg.substr(6) );
673 } else if ( arg.find( "--aircraft=" ) != string::npos ) {
674 aircraft = arg.substr(11);
675 } else if ( arg.find( "--aircraft-dir=" ) != string::npos ) {
676 aircraft_dir = arg.substr(15); // (UIUC)
677 } else if ( arg.find( "--model-hz=" ) != string::npos ) {
678 model_hz = atoi( arg.substr(11) );
679 } else if ( arg.find( "--speed=" ) != string::npos ) {
680 speed_up = atoi( arg.substr(8) );
681 } else if ( arg == "--fog-disable" ) {
682 fog = FG_FOG_DISABLED;
683 } else if ( arg == "--fog-fastest" ) {
684 fog = FG_FOG_FASTEST;
685 } else if ( arg == "--fog-nicest" ) {
687 } else if ( arg == "--disable-clouds" ) {
689 } else if ( arg == "--enable-clouds" ) {
691 } else if ( arg.find( "--clouds-asl=" ) != string::npos ) {
692 if ( units == FG_UNITS_FEET ) {
693 clouds_asl = atof( arg.substr(13) ) * FEET_TO_METER;
695 clouds_asl = atof( arg.substr(13) );
697 } else if ( arg.find( "--fov=" ) != string::npos ) {
698 fov = parse_fov( arg.substr(6) );
699 } else if ( arg == "--disable-fullscreen" ) {
701 } else if ( arg== "--enable-fullscreen") {
703 } else if ( arg == "--shading-flat") {
705 } else if ( arg == "--shading-smooth") {
707 } else if ( arg == "--disable-skyblend") {
709 } else if ( arg== "--enable-skyblend" ) {
711 } else if ( arg == "--disable-textures" ) {
713 } else if ( arg == "--enable-textures" ) {
715 } else if ( arg == "--disable-wireframe" ) {
717 } else if ( arg == "--enable-wireframe" ) {
719 } else if ( arg.find( "--geometry=" ) != string::npos ) {
720 bool geometry_ok = true;
721 string geometry = arg.substr( 11 );
722 string::size_type i = geometry.find('x');
724 if (i != string::npos) {
725 xsize = atoi(geometry.substr(0, i));
726 ysize = atoi(geometry.substr(i+1));
727 // cout << "Geometry is " << xsize << 'x' << ysize << '\n';
732 if ( xsize <= 0 || ysize <= 0 ) {
738 if ( !geometry_ok ) {
739 FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry );
740 FG_LOG( FG_GENERAL, FG_ALERT,
741 "Setting geometry to " << xsize << 'x' << ysize << '\n');
743 } else if ( arg.find( "--bpp=" ) != string::npos ) {
744 string bits_per_pix = arg.substr( 6 );
745 if ( bits_per_pix == "16" ) {
747 } else if ( bits_per_pix == "24" ) {
749 } else if ( bits_per_pix == "32" ) {
752 } else if ( arg == "--units-feet" ) {
753 units = FG_UNITS_FEET;
754 } else if ( arg == "--units-meters" ) {
755 units = FG_UNITS_METERS;
756 } else if ( arg.find( "--tile-radius=" ) != string::npos ) {
757 tile_radius = parse_tile_radius( arg.substr(14) );
758 tile_diameter = tile_radius * 2 + 1;
759 } else if ( arg.find( "--time-offset" ) != string::npos ) {
760 time_offset = parse_time_offset( (arg.substr(14)) );
761 //time_offset_type = FG_TIME_SYS_OFFSET;
762 } else if ( arg.find( "--time-match-real") != string::npos ) {
763 //time_offset = parse_time_offset(arg.substr(18));
764 time_offset_type = FG_TIME_SYS_OFFSET;
765 } else if ( arg.find( "--time-match-local") != string::npos ) {
766 //time_offset = parse_time_offset(arg.substr(18));
767 time_offset_type = FG_TIME_LAT_OFFSET;
768 } else if ( arg.find( "--start-date-sys=") != string::npos ) {
769 time_offset = parse_date( (arg.substr(17)) );
770 time_offset_type = FG_TIME_SYS_ABSOLUTE;
771 } else if ( arg.find( "--start-date-lat=") != string::npos ) {
772 time_offset = parse_date( (arg.substr(17)) );
773 time_offset_type = FG_TIME_LAT_ABSOLUTE;
774 } else if ( arg.find( "--start-date-gmt=") != string::npos ) {
775 time_offset = parse_date( (arg.substr(17)) );
776 time_offset_type = FG_TIME_GMT_ABSOLUTE;
778 } else if ( arg == "--hud-tris" ) {
780 } else if ( arg == "--hud-culled" ) {
782 } else if ( arg.find( "--native=" ) != string::npos ) {
783 parse_channel( "native", arg.substr(9) );
784 } else if ( arg.find( "--garmin=" ) != string::npos ) {
785 parse_channel( "garmin", arg.substr(9) );
786 } else if ( arg.find( "--nmea=" ) != string::npos ) {
787 parse_channel( "nmea", arg.substr(7) );
788 } else if ( arg.find( "--pve=" ) != string::npos ) {
789 parse_channel( "pve", arg.substr(6) );
790 } else if ( arg.find( "--rul=" ) != string::npos ) {
791 parse_channel( "rul", arg.substr(6) );
792 } else if ( arg.find( "--joyclient=" ) != string::npos ) {
793 parse_channel( "joyclient", arg.substr(12) );
794 #ifdef FG_NETWORK_OLK
795 } else if ( arg == "--disable-network-olk" ) {
797 } else if ( arg== "--enable-network-olk") {
799 } else if ( arg == "--net-hud" ) {
801 } else if ( arg.find( "--net-id=") != string::npos ) {
802 net_id = arg.substr( 9 );
805 FG_LOG( FG_GENERAL, FG_ALERT, "Unknown option '" << arg << "'" );
806 return FG_OPTIONS_ERROR;
809 return FG_OPTIONS_OK;
813 // Parse the command line options
814 int fgOPTIONS::parse_command_line( int argc, char **argv ) {
818 FG_LOG(FG_GENERAL, FG_INFO, "Processing command line arguments");
821 FG_LOG( FG_GENERAL, FG_DEBUG, "argv[" << i << "] = " << argv[i] );
823 result = parse_option(argv[i]);
824 if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
831 return(FG_OPTIONS_OK);
835 // Parse config file options
836 int fgOPTIONS::parse_config_file( const string& path ) {
837 fg_gzifstream in( path );
839 return(FG_OPTIONS_ERROR);
841 FG_LOG( FG_GENERAL, FG_INFO, "Processing config file: " << path );
845 while ( ! in.eof() ) {
848 while ( in.get(c) && c != '\0' ) {
853 #ifdef GETLINE_NEEDS_TERMINATOR
854 getline( in, line, '\n' );
855 #elif defined (MACOS)
856 getline( in, line, '\r' );
861 if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
862 FG_LOG( FG_GENERAL, FG_ALERT,
863 "Config file parse error: " << path << " '"
870 return FG_OPTIONS_OK;
874 // Print usage message
875 void fgOPTIONS::usage ( void ) {
876 cout << "Usage: fg [ options ... ]" << endl;
879 cout << "General Options:" << endl;
880 cout << "\t--help -h: print usage" << endl;
881 cout << "\t--fg-root=path: specify the root path for all the data files"
883 cout << "\t--disable-game-mode: disable full-screen game mode" << endl;
884 cout << "\t--enable-game-mode: enable full-screen game mode" << endl;
885 cout << "\t--disable-splash-screen: disable splash screen" << endl;
886 cout << "\t--enable-splash-screen: enable splash screen" << endl;
887 cout << "\t--disable-intro-music: disable introduction music" << endl;
888 cout << "\t--enable-intro-music: enable introduction music" << endl;
889 cout << "\t--disable-mouse-pointer: disable extra mouse pointer" << endl;
890 cout << "\t--enable-mouse-pointer: enable extra mouse pointer (i.e. for"
892 cout << "\t\tfull screen voodoo/voodoo-II based cards.)" << endl;
893 cout << "\t--disable-pause: start out in an active state" << endl;
894 cout << "\t--enable-pause: start out in a paused state" << endl;
895 cout << "\t--control=mode: primary control mode "
896 << "(joystick, keyboard, mouse)" << endl;
899 cout << "Features:" << endl;
900 cout << "\t--disable-hud: disable heads up display" << endl;
901 cout << "\t--enable-hud: enable heads up display" << endl;
902 cout << "\t--disable-panel: disable instrument panel" << endl;
903 cout << "\t--enable-panel: enable instrumetn panel" << endl;
904 cout << "\t--disable-sound: disable sound effects" << endl;
905 cout << "\t--enable-sound: enable sound effects" << endl;
906 cout << "\t--disable-anti-alias-hud: disable anti aliased hud" << endl;
907 cout << "\t--enable-anti-alias-hud: enable anti aliased hud" << endl;
910 cout << "Flight Model:" << endl;
911 cout << "\t--fdm=abcd: selects the core flight model code." << endl;
912 cout << "\t\tcan be one of jsb, larcsim, magic, or external" << endl;
913 cout << "\t--aircraft=abcd: aircraft model to load" << endl;
914 cout << "\t--model-hz=n: run the FDM this rate (iterations per second)"
916 cout << "\t--speed=n: run the FDM this much faster than real time" << endl;
919 cout <<"Aircraft model directory" << endl;
920 cout <<"\t--aircraft-dir=<path> path is relative to the path of the executable" << endl;
923 cout << "Initial Position and Orientation:" << endl;
924 cout << "\t--airport-id=ABCD: specify starting postion by airport id"
926 cout << "\t--lon=degrees: starting longitude in degrees (west = -)"
928 cout << "\t--lat=degrees: starting latitude in degrees (south = -)"
930 cout << "\t--altitude=feet: starting altitude in feet" << endl;
931 cout << "\t\t(unless --units-meters specified" << endl;
932 cout << "\t--heading=degrees: heading (yaw) angle in degress (Psi)"
934 cout << "\t--roll=degrees: roll angle in degrees (Phi)" << endl;
935 cout << "\t--pitch=degrees: pitch angle in degrees (Theta)" << endl;
936 cout << "\t--uBody=feet per second: velocity along the body X axis"
938 cout << "\t--vBody=feet per second: velocity along the body Y axis"
940 cout << "\t--wBody=feet per second: velocity along the body Z axis"
942 cout << "\t\t(unless --units-meters specified" << endl;
945 cout << "Rendering Options:" << endl;
946 cout << "\t--fog-disable: disable fog/haze" << endl;
947 cout << "\t--fog-fastest: enable fastest fog/haze" << endl;
948 cout << "\t--fog-nicest: enable nicest fog/haze" << endl;
949 cout << "\t--enable-clouds: enable demo cloud layer" << endl;
950 cout << "\t--disable-clouds: disable demo cloud layer" << endl;
951 cout << "\t--clouds-asl=xxx: specify altitude of cloud layer above sea level" << endl;
952 cout << "\t--fov=xx.x: specify initial field of view angle in degrees"
954 cout << "\t--disable-fullscreen: disable fullscreen mode" << endl;
955 cout << "\t--enable-fullscreen: enable fullscreen mode" << endl;
956 cout << "\t--shading-flat: enable flat shading" << endl;
957 cout << "\t--shading-smooth: enable smooth shading" << endl;
958 cout << "\t--disable-skyblend: disable sky blending" << endl;
959 cout << "\t--enable-skyblend: enable sky blending" << endl;
960 cout << "\t--disable-textures: disable textures" << endl;
961 cout << "\t--enable-textures: enable textures" << endl;
962 cout << "\t--disable-wireframe: disable wireframe drawing mode" << endl;
963 cout << "\t--enable-wireframe: enable wireframe drawing mode" << endl;
964 cout << "\t--geometry=WWWxHHH: window geometry: 640x480, 800x600, etc."
968 cout << "Scenery Options:" << endl;
969 cout << "\t--tile-radius=n: specify tile radius, must be 1 - 4" << endl;
972 cout << "Hud Options:" << endl;
973 cout << "\t--units-feet: Hud displays units in feet" << endl;
974 cout << "\t--units-meters: Hud displays units in meters" << endl;
975 cout << "\t--hud-tris: Hud displays number of triangles rendered" << endl;
976 cout << "\t--hud-culled: Hud displays percentage of triangles culled"
980 cout << "Time Options:" << endl;
981 cout << "\t--time-offset=[+-]hh:mm:ss: add this time offset" << endl;
982 cout << "\t--time-match-real: Synchronize real-world and FlightGear" << endl
983 << "\t\ttime. Can be used in combination with --time-offset." << endl;
984 cout << "\t--time-match-local:Synchronize local real-world and " << endl
985 << "\t\tFlightGear time" << endl;
986 cout << "\t--start-date-sys=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
987 << "\t\tdate/time. Uses your system time " << endl;
988 cout << "\t--start-date-gmt=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
989 << "\t\tdate/time. Uses Greenwich Mean Time" << endl;
990 cout << "\t--start-date-lat=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
991 << "\t\tdate/time. Uses Local Aircraft Time" << endl;
992 #ifdef FG_NETWORK_OLK
995 cout << "Network Options:" << endl;
996 cout << "\t--net-hud: Hud displays network info" << endl;
997 cout << "\t--net-id=name: specify your own callsign" << endl;
1003 fgOPTIONS::~fgOPTIONS( void ) {