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>
44 #include <simgear/misc/props.hxx>
45 #include <simgear/timing/sg_time.hxx>
47 #include <Include/general.hxx>
48 #include <Cockpit/cockpit.hxx>
49 #include <FDM/flight.hxx>
50 #include <FDM/UIUCModel/uiuc_aircraftdir.h>
52 # include <NetworkOLK/network.h>
55 #include "globals.hxx"
56 #include "options.hxx"
60 FG_USING_NAMESPACE(std);
63 extern void fgReshape( int width, int height );
66 atof( const string& str )
70 // -dw- if ::atof is called, then we get an infinite loop
71 return std::atof( str.c_str() );
73 return ::atof( str.c_str() );
78 atoi( const string& str )
81 // -dw- if ::atoi is called, then we get an infinite loop
82 return std::atoi( str.c_str() );
84 return ::atoi( str.c_str() );
89 // Defined the shared options class here
90 fgOPTIONS current_options;
94 fgOPTIONS::fgOPTIONS() :
95 // starting longitude in degrees (west = -)
96 // starting latitude in degrees (south = -)
98 // Default initial position is Globe, AZ (P13)
102 // North of the city of Globe
106 // North of the city of Globe
110 // Near where I used to live in Globe, AZ
114 // 10125 Jewell St. NE
118 // Near KHSP (Hot Springs, VA)
119 // lon(-79.8338964 + 0.01),
120 // lat( 37.9514564 + 0.008),
122 // (SEZ) SEDONA airport
123 // lon(-111.7884614 + 0.01),
124 // lat( 34.8486289 - 0.015),
126 // Jim Brennon's Kingmont Observatory
127 // lon(-121.1131667),
130 // Huaras, Peru (S09d 31.871' W077d 31.498')
134 // Eclipse Watching w73.5 n10 (approx) 18:00 UT
139 // lon(-90.1953055556),
140 // lat( 45.4511388889),
142 // starting altitude in meters (this will be reset to ground level
143 // if it is lower than the terrain
146 // Initial Orientation
147 heading(270.0), // heading (yaw) angle in degress (Psi)
148 roll(0.0), // roll angle in degrees (Phi)
149 pitch(0.424), // pitch angle in degrees (Theta)
151 // Initialize current options velocities to 0.0
152 uBody(0.0), vBody(0.0), wBody(0.0), vkcas(0.0), mach(0.0),
159 control_mode(FG_JOYSTICK),
160 auto_coordination(FG_AUTO_COORD_NOT_SPECIFIED),
168 // Flight Model options
169 flight_model( FGInterface::FG_LARCSIM ),
171 model_hz( NEW_DEFAULT_MODEL_HZ ),
176 fog(FG_FOG_NICEST), // nicest
178 clouds_asl(5000*FEET_TO_METER),
188 view_mode(FG_VIEW_PILOT),
194 units(FG_UNITS_FEET),
202 // set initial values/defaults
203 time_offset_type = FG_TIME_SYS_OFFSET;
204 char* envp = ::getenv( "FG_ROOT" );
206 if ( envp != NULL ) {
207 // fg_root could be anywhere, so default to environmental
208 // variable $FG_ROOT if it is set.
211 // Otherwise, default to a random compiled-in location if
212 // $FG_ROOT is not set. This can still be overridden from the
213 // command line or a config file.
216 fg_root = "\\FlightGear";
217 #elif defined( MACOS )
224 // set a possibly independent location for scenery data
225 envp = ::getenv( "FG_SCENERY" );
227 if ( envp != NULL ) {
228 // fg_root could be anywhere, so default to environmental
229 // variable $FG_ROOT if it is set.
232 // Otherwise, default to Scenery being in $FG_ROOT/Scenery
233 FGPath tmp( fg_root );
234 tmp.append( "Scenery" );
235 fg_scenery = tmp.str();
238 airport_id = ""; // default airport id
239 net_id = "Johnney"; // default pilot's name
241 // initialize port config string list
242 channel_options_list.clear();
246 fgOPTIONS::toggle_panel() {
248 bool freeze = globals->get_freeze();
251 globals->set_freeze(true);
254 panel_status = false;
255 if ( current_panel != NULL )
256 current_panel->setVisibility(false);
259 if ( current_panel != NULL )
260 current_panel->setVisibility(true);
262 if ( panel_status ) {
265 fov *= (1.0 / 0.4232);
267 // fgReshape( xsize, ysize);
268 fgReshape( current_view.get_winWidth(), current_view.get_winHeight() );
271 globals->set_freeze( false );
275 fgOPTIONS::parse_time(const string& time_in) {
276 char *time_str, num[256];
277 double hours, minutes, seconds;
282 time_str = (char *)time_in.c_str();
284 // printf("parse_time(): %s\n", time_str);
287 if ( strlen(time_str) ) {
288 if ( time_str[0] == '+' ) {
291 } else if ( time_str[0] == '-' ) {
296 // printf("sign = %d\n", sign);
299 if ( strlen(time_str) ) {
301 while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
302 num[i] = time_str[0];
306 if ( time_str[0] == ':' ) {
311 // printf("hours = %.2lf\n", hours);
317 if ( strlen(time_str) ) {
319 while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
320 num[i] = time_str[0];
324 if ( time_str[0] == ':' ) {
329 // printf("minutes = %.2lf\n", minutes);
331 result += minutes / 60.0;
335 if ( strlen(time_str) ) {
337 while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
338 num[i] = time_str[0];
344 // printf("seconds = %.2lf\n", seconds);
346 result += seconds / 3600.0;
349 return(sign * result);
353 long int fgOPTIONS::parse_date( const string& date)
356 char * date_str, num[256];
358 // initialize to zero
365 gmt.tm_isdst = 0; // ignore daylight savings time for the moment
366 date_str = (char *)date.c_str();
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_year = atoi(num) - 1900;
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_mon = atoi(num) -1;
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_mday = 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_hour = 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_min = atoi(num);
438 if ( strlen(date_str) ) {
440 while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
441 num[i] = date_str[0];
445 if ( date_str[0] == ':' ) {
449 gmt.tm_sec = atoi(num);
451 time_t theTime = sgTimeGetGMT( gmt.tm_year, gmt.tm_mon, gmt.tm_mday,
452 gmt.tm_hour, gmt.tm_min, gmt.tm_sec );
453 //printf ("Date is %s\n", ctime(&theTime));
454 //printf ("in seconds that is %d\n", theTime);
460 // parse degree in the form of [+/-]hhh:mm:ss
461 void fgOPTIONS::parse_control( const string& mode ) {
462 if ( mode == "joystick" ) {
463 control_mode = FG_JOYSTICK;
464 } else if ( mode == "mouse" ) {
465 control_mode = FG_MOUSE;
467 control_mode = FG_KEYBOARD;
472 /// parse degree in the form of [+/-]hhh:mm:ss
474 fgOPTIONS::parse_degree( const string& degree_str) {
475 double result = parse_time( degree_str );
477 // printf("Degree = %.4f\n", result);
483 // parse time offset command line option
485 fgOPTIONS::parse_time_offset( const string& time_str) {
488 // printf("time offset = %s\n", time_str);
491 result = (int)rint(parse_time(time_str) * 3600.0);
493 result = (int)(parse_time(time_str) * 3600.0);
496 // printf("parse_time_offset(): %d\n", result);
502 // Parse --tile-diameter=n type option
505 fgOPTIONS::parse_tile_radius( const string& arg ) {
506 int radius = atoi( arg );
508 if ( radius < FG_RADIUS_MIN ) { radius = FG_RADIUS_MIN; }
509 if ( radius > FG_RADIUS_MAX ) { radius = FG_RADIUS_MAX; }
511 // printf("parse_tile_radius(): radius = %d\n", radius);
517 // Parse --fdm=abcdefg type option
519 fgOPTIONS::parse_fdm( const string& fm ) {
520 // cout << "fdm = " << fm << endl;
522 if ( fm == "balloon" ) {
523 return FGInterface::FG_BALLOONSIM;
524 } else if ( fm == "external" ) {
525 return FGInterface::FG_EXTERNAL;
526 } else if ( fm == "jsb" ) {
527 return FGInterface::FG_JSBSIM;
528 } else if ( (fm == "larcsim") || (fm == "LaRCsim") ) {
529 return FGInterface::FG_LARCSIM;
530 } else if ( fm == "magic" ) {
531 return FGInterface::FG_MAGICCARPET;
533 FG_LOG( FG_GENERAL, FG_ALERT, "Unknown fdm = " << fm );
537 // we'll never get here, but it makes the compiler happy.
542 // Parse --fov=x.xx type option
544 fgOPTIONS::parse_fov( const string& arg ) {
545 double fov = atof(arg);
547 if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
548 if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
550 // printf("parse_fov(): result = %.4f\n", fov);
556 // Parse I/O channel option
558 // Format is "--protocol=medium,direction,hz,medium_options,..."
560 // protocol = { native, nmea, garmin, fgfs, rul, pve, etc. }
561 // medium = { serial, socket, file, etc. }
562 // direction = { in, out, bi }
563 // hz = number of times to process channel per second (floating
564 // point values are ok.
566 // Serial example "--nmea=serial,dir,hz,device,baud" where
568 // device = OS device name of serial line to be open()'ed
569 // baud = {300, 1200, 2400, ..., 230400}
571 // Socket exacmple "--native=socket,dir,hz,machine,port,style" where
573 // machine = machine name or ip address if client (leave empty if server)
574 // port = port, leave empty to let system choose
575 // style = tcp or udp
577 // File example "--garmin=file,dir,hz,filename" where
579 // filename = file system file name
582 fgOPTIONS::parse_channel( const string& type, const string& channel_str ) {
583 // cout << "Channel string = " << channel_str << endl;
585 channel_options_list.push_back( type + "," + channel_str );
591 // Parse a single option
592 int fgOPTIONS::parse_option( const string& arg ) {
594 if ( (arg == "--help") || (arg == "-h") ) {
595 // help/usage request
596 return(FG_OPTIONS_HELP);
597 } else if ( arg == "--disable-game-mode") {
599 } else if ( arg == "--enable-game-mode" ) {
601 } else if ( arg == "--disable-splash-screen" ) {
602 splash_screen = false;
603 } else if ( arg == "--enable-splash-screen" ) {
604 splash_screen = true;
605 } else if ( arg == "--disable-intro-music" ) {
607 } else if ( arg == "--enable-intro-music" ) {
609 } else if ( arg == "--disable-mouse-pointer" ) {
611 } else if ( arg == "--enable-mouse-pointer" ) {
613 } else if ( arg == "--disable-freeze" ) {
614 globals->set_freeze( false );
615 } else if ( arg == "--enable-freeze" ) {
616 globals->set_freeze( true );
617 } else if ( arg == "--disable-anti-alias-hud" ) {
618 anti_alias_hud = false;
619 } else if ( arg == "--enable-anti-alias-hud" ) {
620 anti_alias_hud = true;
621 } else if ( arg.find( "--control=") != string::npos ) {
622 parse_control( arg.substr(10) );
623 } else if ( arg == "--disable-auto-coordination" ) {
624 auto_coordination = FG_AUTO_COORD_DISABLED;
625 } else if ( arg == "--enable-auto-coordination" ) {
626 auto_coordination = FG_AUTO_COORD_ENABLED;
627 } else if ( arg == "--disable-hud" ) {
629 } else if ( arg == "--enable-hud" ) {
631 } else if ( arg == "--disable-panel" ) {
632 panel_status = false;
633 if ( current_panel != NULL )
634 current_panel->setVisibility(false);
635 } else if ( arg == "--enable-panel" ) {
637 if ( current_panel != NULL )
638 current_panel->setVisibility(true);
640 } else if ( arg == "--disable-sound" ) {
642 } else if ( arg == "--enable-sound" ) {
644 } else if ( arg.find( "--airport-id=") != string::npos ) {
645 airport_id = arg.substr( 13 );
646 } else if ( arg.find( "--lon=" ) != string::npos ) {
647 lon = parse_degree( arg.substr(6) );
648 } else if ( arg.find( "--lat=" ) != string::npos ) {
649 lat = parse_degree( arg.substr(6) );
650 } else if ( arg.find( "--altitude=" ) != string::npos ) {
651 if ( units == FG_UNITS_FEET ) {
652 altitude = atof( arg.substr(11) ) * FEET_TO_METER;
654 altitude = atof( arg.substr(11) );
656 } else if ( arg.find( "--uBody=" ) != string::npos ) {
658 if ( units == FG_UNITS_FEET ) {
659 uBody = atof( arg.substr(8) );
661 uBody = atof( arg.substr(8) ) * FEET_TO_METER;
663 } else if ( arg.find( "--vBody=" ) != string::npos ) {
665 if ( units == FG_UNITS_FEET ) {
666 vBody = atof( arg.substr(8) );
668 vBody = atof( arg.substr(8) ) * FEET_TO_METER;
670 } else if ( arg.find( "--wBody=" ) != string::npos ) {
672 if ( units == FG_UNITS_FEET ) {
673 wBody = atof( arg.substr(8) );
675 wBody = atof( arg.substr(8) ) * FEET_TO_METER;
677 } else if ( arg.find( "--vc=" ) != string::npos) {
679 vkcas=atof( arg.substr(5) );
680 cout << "Got vc: " << vkcas << endl;
681 } else if ( arg.find( "--mach=" ) != string::npos) {
683 mach=atof( arg.substr(7) );
684 } else if ( arg.find( "--heading=" ) != string::npos ) {
685 heading = atof( arg.substr(10) );
686 } else if ( arg.find( "--roll=" ) != string::npos ) {
687 roll = atof( arg.substr(7) );
688 } else if ( arg.find( "--pitch=" ) != string::npos ) {
689 pitch = atof( arg.substr(8) );
690 } else if ( arg.find( "--fg-root=" ) != string::npos ) {
691 fg_root = arg.substr( 10 );
692 } else if ( arg.find( "--fg-scenery=" ) != string::npos ) {
693 fg_scenery = arg.substr( 13 );
694 } else if ( arg.find( "--fdm=" ) != string::npos ) {
695 flight_model = parse_fdm( arg.substr(6) );
696 if((flight_model == FGInterface::FG_JSBSIM) && (get_trim_mode() == 0)) {
701 } else if ( arg.find( "--aircraft=" ) != string::npos ) {
702 aircraft = arg.substr(11);
703 } else if ( arg.find( "--aircraft-dir=" ) != string::npos ) {
704 aircraft_dir = arg.substr(15); // (UIUC)
705 } else if ( arg.find( "--model-hz=" ) != string::npos ) {
706 model_hz = atoi( arg.substr(11) );
707 } else if ( arg.find( "--speed=" ) != string::npos ) {
708 speed_up = atoi( arg.substr(8) );
709 } else if ( arg.find( "--notrim") != string::npos) {
711 } else if ( arg == "--fog-disable" ) {
712 fog = FG_FOG_DISABLED;
713 } else if ( arg == "--fog-fastest" ) {
714 fog = FG_FOG_FASTEST;
715 } else if ( arg == "--fog-nicest" ) {
717 } else if ( arg == "--disable-clouds" ) {
719 } else if ( arg == "--enable-clouds" ) {
721 } else if ( arg.find( "--clouds-asl=" ) != string::npos ) {
722 if ( units == FG_UNITS_FEET ) {
723 clouds_asl = atof( arg.substr(13) ) * FEET_TO_METER;
725 clouds_asl = atof( arg.substr(13) );
727 } else if ( arg.find( "--fov=" ) != string::npos ) {
728 fov = parse_fov( arg.substr(6) );
729 } else if ( arg == "--disable-fullscreen" ) {
731 } else if ( arg== "--enable-fullscreen") {
733 } else if ( arg == "--shading-flat") {
735 } else if ( arg == "--shading-smooth") {
737 } else if ( arg == "--disable-skyblend") {
739 } else if ( arg== "--enable-skyblend" ) {
741 } else if ( arg == "--disable-textures" ) {
743 } else if ( arg == "--enable-textures" ) {
745 } else if ( arg == "--disable-wireframe" ) {
747 } else if ( arg == "--enable-wireframe" ) {
749 } else if ( arg.find( "--geometry=" ) != string::npos ) {
750 bool geometry_ok = true;
751 string geometry = arg.substr( 11 );
752 string::size_type i = geometry.find('x');
754 if (i != string::npos) {
755 xsize = atoi(geometry.substr(0, i));
756 ysize = atoi(geometry.substr(i+1));
757 // cout << "Geometry is " << xsize << 'x' << ysize << '\n';
762 if ( xsize <= 0 || ysize <= 0 ) {
768 if ( !geometry_ok ) {
769 FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry );
770 FG_LOG( FG_GENERAL, FG_ALERT,
771 "Setting geometry to " << xsize << 'x' << ysize << '\n');
773 } else if ( arg.find( "--bpp=" ) != string::npos ) {
774 string bits_per_pix = arg.substr( 6 );
775 if ( bits_per_pix == "16" ) {
777 } else if ( bits_per_pix == "24" ) {
779 } else if ( bits_per_pix == "32" ) {
782 } else if ( arg == "--units-feet" ) {
783 units = FG_UNITS_FEET;
784 } else if ( arg == "--units-meters" ) {
785 units = FG_UNITS_METERS;
786 } else if ( arg.find( "--tile-radius=" ) != string::npos ) {
787 tile_radius = parse_tile_radius( arg.substr(14) );
788 tile_diameter = tile_radius * 2 + 1;
789 } else if ( arg.find( "--time-offset" ) != string::npos ) {
790 time_offset = parse_time_offset( (arg.substr(14)) );
791 //time_offset_type = FG_TIME_SYS_OFFSET;
792 } else if ( arg.find( "--time-match-real") != string::npos ) {
793 //time_offset = parse_time_offset(arg.substr(18));
794 time_offset_type = FG_TIME_SYS_OFFSET;
795 } else if ( arg.find( "--time-match-local") != string::npos ) {
796 //time_offset = parse_time_offset(arg.substr(18));
797 time_offset_type = FG_TIME_LAT_OFFSET;
798 } else if ( arg.find( "--start-date-sys=") != string::npos ) {
799 time_offset = parse_date( (arg.substr(17)) );
800 time_offset_type = FG_TIME_SYS_ABSOLUTE;
801 } else if ( arg.find( "--start-date-lat=") != string::npos ) {
802 time_offset = parse_date( (arg.substr(17)) );
803 time_offset_type = FG_TIME_LAT_ABSOLUTE;
804 } else if ( arg.find( "--start-date-gmt=") != string::npos ) {
805 time_offset = parse_date( (arg.substr(17)) );
806 time_offset_type = FG_TIME_GMT_ABSOLUTE;
808 } else if ( arg == "--hud-tris" ) {
810 } else if ( arg == "--hud-culled" ) {
812 } else if ( arg.find( "--native=" ) != string::npos ) {
813 parse_channel( "native", arg.substr(9) );
814 } else if ( arg.find( "--garmin=" ) != string::npos ) {
815 parse_channel( "garmin", arg.substr(9) );
816 } else if ( arg.find( "--nmea=" ) != string::npos ) {
817 parse_channel( "nmea", arg.substr(7) );
818 } else if ( arg.find( "--pve=" ) != string::npos ) {
819 parse_channel( "pve", arg.substr(6) );
820 } else if ( arg.find( "--ray=" ) != string::npos ) {
821 parse_channel( "ray", arg.substr(6) );
822 } else if ( arg.find( "--rul=" ) != string::npos ) {
823 parse_channel( "rul", arg.substr(6) );
824 } else if ( arg.find( "--joyclient=" ) != string::npos ) {
825 parse_channel( "joyclient", arg.substr(12) );
826 #ifdef FG_NETWORK_OLK
827 } else if ( arg == "--disable-network-olk" ) {
829 } else if ( arg== "--enable-network-olk") {
831 } else if ( arg == "--net-hud" ) {
833 } else if ( arg.find( "--net-id=") != string::npos ) {
834 net_id = arg.substr( 9 );
836 } else if ( arg.find( "--prop:" ) == 0 ) {
837 string assign = arg.substr(7);
838 int pos = assign.find('=');
839 if (pos == arg.npos || pos == 0) {
840 FG_LOG(FG_GENERAL, FG_ALERT, "Bad property assignment: " << arg);
841 return FG_OPTIONS_ERROR;
843 string name = assign.substr(0, pos);
844 string value = assign.substr(pos + 1);
845 current_properties.setStringValue(name.c_str(), value);
846 FG_LOG(FG_GENERAL, FG_INFO, "Setting default value of property "
847 << name << " to \"" << value << '"');
849 FG_LOG( FG_GENERAL, FG_ALERT, "Unknown option '" << arg << "'" );
850 return FG_OPTIONS_ERROR;
853 return FG_OPTIONS_OK;
857 // Parse the command line options
858 int fgOPTIONS::parse_command_line( int argc, char **argv ) {
862 FG_LOG(FG_GENERAL, FG_INFO, "Processing command line arguments");
865 FG_LOG( FG_GENERAL, FG_DEBUG, "argv[" << i << "] = " << argv[i] );
867 result = parse_option(argv[i]);
868 if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
875 return(FG_OPTIONS_OK);
879 // Parse config file options
880 int fgOPTIONS::parse_config_file( const string& path ) {
881 fg_gzifstream in( path );
883 return(FG_OPTIONS_ERROR);
885 FG_LOG( FG_GENERAL, FG_INFO, "Processing config file: " << path );
889 while ( ! in.eof() ) {
892 while ( in.get(c) && c != '\0' ) {
897 #ifdef GETLINE_NEEDS_TERMINATOR
898 getline( in, line, '\n' );
899 #elif defined (MACOS)
900 getline( in, line, '\r' );
905 if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
906 FG_LOG( FG_GENERAL, FG_ALERT,
907 "Config file parse error: " << path << " '"
914 return FG_OPTIONS_OK;
918 // Print usage message
919 void fgOPTIONS::usage ( void ) {
920 cout << "Usage: fg [ options ... ]" << endl;
923 cout << "General Options:" << endl;
924 cout << "\t--help -h: print usage" << endl;
925 cout << "\t--fg-root=path: specify the root path for all the data files"
927 cout << "\t--fg-scenery=path: specify the base path for all the scenery"
929 << "\t\tdefaults to $FG_ROOT/Scenery" << endl;
930 cout << "\t--disable-game-mode: disable full-screen game mode" << endl;
931 cout << "\t--enable-game-mode: enable full-screen game mode" << endl;
932 cout << "\t--disable-splash-screen: disable splash screen" << endl;
933 cout << "\t--enable-splash-screen: enable splash screen" << endl;
934 cout << "\t--disable-intro-music: disable introduction music" << endl;
935 cout << "\t--enable-intro-music: enable introduction music" << endl;
936 cout << "\t--disable-mouse-pointer: disable extra mouse pointer" << endl;
937 cout << "\t--enable-mouse-pointer: enable extra mouse pointer (i.e. for"
939 cout << "\t\tfull screen voodoo/voodoo-II based cards.)" << endl;
940 cout << "\t--disable-freeze: start out in an running state" << endl;
941 cout << "\t--enable-freeze: start out in a frozen state" << endl;
942 cout << "\t--control=mode: primary control mode "
943 << "(joystick, keyboard, mouse)" << endl;
946 cout << "Features:" << endl;
947 cout << "\t--disable-hud: disable heads up display" << endl;
948 cout << "\t--enable-hud: enable heads up display" << endl;
949 cout << "\t--disable-panel: disable instrument panel" << endl;
950 cout << "\t--enable-panel: enable instrumetn panel" << endl;
951 cout << "\t--disable-sound: disable sound effects" << endl;
952 cout << "\t--enable-sound: enable sound effects" << endl;
953 cout << "\t--disable-anti-alias-hud: disable anti aliased hud" << endl;
954 cout << "\t--enable-anti-alias-hud: enable anti aliased hud" << endl;
957 cout << "Flight Model:" << endl;
958 cout << "\t--fdm=abcd: selects the core flight model code." << endl;
959 cout << "\t\tcan be one of jsb, larcsim, magic, or external" << endl;
960 cout << "\t--aircraft=abcd: aircraft model to load" << endl;
961 cout << "\t--model-hz=n: run the FDM this rate (iterations per second)"
963 cout << "\t--speed=n: run the FDM this much faster than real time" << endl;
964 cout << "\t--notrim: Do NOT attempt to trim the model when initializing JSBsim" << endl;
967 cout <<"Aircraft model directory" << endl;
968 cout <<"\t--aircraft-dir=<path> path is relative to the path of the executable" << endl;
971 cout << "Initial Position and Orientation:" << endl;
972 cout << "\t--airport-id=ABCD: specify starting postion by airport id"
974 cout << "\t--lon=degrees: starting longitude in degrees (west = -)"
976 cout << "\t--lat=degrees: starting latitude in degrees (south = -)"
978 cout << "\t--altitude=feet: starting altitude in feet" << endl;
979 cout << "\t\t(unless --units-meters specified" << endl;
980 cout << "\t--heading=degrees: heading (yaw) angle in degress (Psi)"
982 cout << "\t--roll=degrees: roll angle in degrees (Phi)" << endl;
983 cout << "\t--pitch=degrees: pitch angle in degrees (Theta)" << endl;
984 cout << "\t--uBody=feet per second: velocity along the body X axis"
986 cout << "\t--vBody=feet per second: velocity along the body Y axis"
988 cout << "\t--wBody=feet per second: velocity along the body Z axis"
990 cout << "\t\t(unless --units-meters specified" << endl;
991 cout << "\t--vc= initial airspeed in knots (--fdm=jsb only)" << endl;
992 cout << "\t--mach= initial mach number (--fdm=jsb only)" << endl;
995 cout << "Rendering Options:" << endl;
996 cout << "\t--fog-disable: disable fog/haze" << endl;
997 cout << "\t--fog-fastest: enable fastest fog/haze" << endl;
998 cout << "\t--fog-nicest: enable nicest fog/haze" << endl;
999 cout << "\t--enable-clouds: enable demo cloud layer" << endl;
1000 cout << "\t--disable-clouds: disable demo cloud layer" << endl;
1001 cout << "\t--clouds-asl=xxx: specify altitude of cloud layer above sea level" << endl;
1002 cout << "\t--fov=xx.x: specify initial field of view angle in degrees"
1004 cout << "\t--disable-fullscreen: disable fullscreen mode" << endl;
1005 cout << "\t--enable-fullscreen: enable fullscreen mode" << endl;
1006 cout << "\t--shading-flat: enable flat shading" << endl;
1007 cout << "\t--shading-smooth: enable smooth shading" << endl;
1008 cout << "\t--disable-skyblend: disable sky blending" << endl;
1009 cout << "\t--enable-skyblend: enable sky blending" << endl;
1010 cout << "\t--disable-textures: disable textures" << endl;
1011 cout << "\t--enable-textures: enable textures" << endl;
1012 cout << "\t--disable-wireframe: disable wireframe drawing mode" << endl;
1013 cout << "\t--enable-wireframe: enable wireframe drawing mode" << endl;
1014 cout << "\t--geometry=WWWxHHH: window geometry: 640x480, 800x600, etc."
1018 cout << "Scenery Options:" << endl;
1019 cout << "\t--tile-radius=n: specify tile radius, must be 1 - 4" << endl;
1022 cout << "Hud Options:" << endl;
1023 cout << "\t--units-feet: Hud displays units in feet" << endl;
1024 cout << "\t--units-meters: Hud displays units in meters" << endl;
1025 cout << "\t--hud-tris: Hud displays number of triangles rendered" << endl;
1026 cout << "\t--hud-culled: Hud displays percentage of triangles culled"
1030 cout << "Time Options:" << endl;
1031 cout << "\t--time-offset=[+-]hh:mm:ss: add this time offset" << endl;
1032 cout << "\t--time-match-real: Synchronize real-world and FlightGear" << endl
1033 << "\t\ttime. Can be used in combination with --time-offset." << endl;
1034 cout << "\t--time-match-local:Synchronize local real-world and " << endl
1035 << "\t\tFlightGear time" << endl;
1036 cout << "\t--start-date-sys=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1037 << "\t\tdate/time. Uses your system time " << endl;
1038 cout << "\t--start-date-gmt=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1039 << "\t\tdate/time. Uses Greenwich Mean Time" << endl;
1040 cout << "\t--start-date-lat=yyyy:mm:dd:hh:mm:ss: specify a starting" << endl
1041 << "\t\tdate/time. Uses Local Aircraft Time" << endl;
1042 #ifdef FG_NETWORK_OLK
1045 cout << "Network Options:" << endl;
1046 cout << "\t--net-hud: Hud displays network info" << endl;
1047 cout << "\t--net-id=name: specify your own callsign" << endl;
1053 fgOPTIONS::~fgOPTIONS( void ) {