]> git.mxchange.org Git - flightgear.git/blob - src/Main/options.cxx
48bfe14ae076e3a1037a742c9713701c652a0781
[flightgear.git] / src / Main / options.cxx
1 // options.cxx -- class to handle command line options
2 //
3 // Written by Curtis Olson, started April 1998.
4 //
5 // Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
6 //
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.
11 //
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.
16 //
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.
20 //
21 // $Id$
22
23
24 #ifdef HAVE_CONFIG_H
25 #  include <config.h>
26 #endif
27
28 #if defined(FX) && defined(XMESA)
29 bool global_fullscreen = true;
30 #endif
31
32 #include <Include/compiler.h>
33
34 #include <math.h>            // rint()
35 #include <stdio.h>
36 #include <stdlib.h>          // atof(), atoi()
37 #include <string.h>
38
39 #include STL_STRING
40
41 #include <Include/fg_constants.h>
42 #include <Include/general.hxx>
43 #include <Cockpit/cockpit.hxx>
44 #include <Debug/logstream.hxx>
45 #include <FDM/flight.hxx>
46 #include <Misc/fgstream.hxx>
47 #ifdef FG_NETWORK_OLK
48 #  include <Network/network.h>
49 #endif
50 #include <Time/fg_time.hxx>
51
52 #include "options.hxx"
53 #include "fg_serial.hxx"
54
55 FG_USING_STD(string);
56 FG_USING_NAMESPACE(std);
57
58 // from GLUTmain.cxx
59 extern void fgReshape( int width, int height );
60
61 inline double
62 atof( const string& str )
63 {
64
65 #ifdef __MWERKS__ 
66     // -dw- if ::atof is called, then we get an infinite loop
67     return std::atof( str.c_str() );
68 #else
69     return ::atof( str.c_str() );
70 #endif
71 }
72
73 inline int
74 atoi( const string& str )
75 {
76 #ifdef __MWERKS__ 
77     // -dw- if ::atoi is called, then we get an infinite loop
78     return std::atoi( str.c_str() );
79 #else
80     return ::atoi( str.c_str() );
81 #endif
82 }
83
84 // Defined the shared options class here
85 fgOPTIONS current_options;
86
87
88 // Constructor
89 fgOPTIONS::fgOPTIONS() :
90     // starting longitude in degrees (west = -)
91     // starting latitude in degrees (south = -)
92
93     // Default initial position is Globe, AZ (P13)
94     lon(-110.6642444),
95     lat(  33.3528917),
96
97     // North of the city of Globe
98     // lon(-110.7),
99     // lat(  33.4),
100
101     // North of the city of Globe
102     // lon(-110.742578),
103     // lat(  33.507122),
104
105     // Near where I used to live in Globe, AZ
106     // lon(-110.766000),
107     // lat(  33.377778),
108
109     // 10125 Jewell St. NE
110     // lon(-93.15),
111     // lat( 45.15),
112
113     // Near KHSP (Hot Springs, VA)
114     // lon(-79.8338964 + 0.01),
115     // lat( 37.9514564 + 0.008),
116
117     // (SEZ) SEDONA airport
118     // lon(-111.7884614 + 0.01),
119     // lat(  34.8486289 - 0.015),
120
121     // Jim Brennon's Kingmont Observatory
122     // lon(-121.1131667),
123     // lat(  38.8293917),
124
125     // Huaras, Peru (S09d 31.871'  W077d 31.498')
126     // lon(-77.5249667),
127     // lat( -9.5311833),
128  
129     // Eclipse Watching w73.5 n10 (approx) 18:00 UT
130     // lon(-73.5),
131     // lat( 10.0),
132
133     // Timms Hill (WI)
134     // lon(-90.1953055556),
135     // lat( 45.4511388889),
136
137     // starting altitude in meters (this will be reset to ground level
138     // if it is lower than the terrain
139     altitude(-9999.0),
140
141     // Initialize current options velocities to 0.0
142     uBody(0.0), vBody(0.0), wBody(0.0),
143
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)
148
149     // Miscellaneous
150     game_mode(0),
151     splash_screen(1),
152     intro_music(1),
153     mouse_pointer(0),
154     pause(0),
155
156     // Features
157     hud_status(1),
158     panel_status(0),
159     sound(1),
160
161     // Flight Model options
162     flight_model(FGInterface::FG_LARCSIM),
163
164     // Rendering options
165     fog(FG_FOG_NICEST),  // nicest
166     fov(55.0),
167     fullscreen(0),
168     shading(1),
169     skyblend(1),
170     textures(1),
171     wireframe(0),
172     xsize(640),
173     ysize(480),
174
175     // Scenery options
176     tile_diameter(5),
177
178     // HUD options
179     units(FG_UNITS_FEET),
180     tris_or_culled(0),
181         
182     // Time options
183     time_offset(0),
184     start_gst(0),
185     start_lst(0)
186
187 {
188     // set initial values/defaults
189     char* envp = ::getenv( "FG_ROOT" );
190
191     if ( envp != NULL ) {
192         // fg_root could be anywhere, so default to environmental
193         // variable $FG_ROOT if it is set.
194         fg_root = envp;
195     } else {
196         // Otherwise, default to a random compiled in location if
197         // $FG_ROOT is not set.  This can still be overridden from the
198         // command line or a config file.
199
200 #if defined( WIN32 )
201         fg_root = "\\FlightGear";
202 #elif defined( MACOS )
203         fg_root = "";
204 #else
205         fg_root = PKGLIBDIR;
206 #endif
207     }
208
209     airport_id = "";            // default airport id
210     net_id = "Johnney";         // default pilot's name
211
212     // initialize port config string list
213     port_options_list.erase ( port_options_list.begin(), 
214                               port_options_list.end() );
215 }
216
217 void 
218 fgOPTIONS::toggle_panel() {
219     
220     FGTime *t = FGTime::cur_time_params;
221     
222     int toggle_pause = t->getPause();
223     
224     if( !toggle_pause )
225         t->togglePauseMode();
226     
227     if( panel_status ) {
228         panel_status = false;
229     } else {
230         panel_status = true;
231     }
232     if ( panel_status ) {
233         if( FGPanel::OurPanel == 0)
234             new FGPanel;
235         fov *= 0.4232;
236     } else {
237         fov *= (1.0 / 0.4232);
238     }
239     fgReshape( xsize, ysize);
240     
241     if( !toggle_pause )
242         t->togglePauseMode();
243 }
244
245 double
246 fgOPTIONS::parse_time(const string& time_in) {
247     char *time_str, num[256];
248     double hours, minutes, seconds;
249     double result = 0.0;
250     int sign = 1;
251     int i;
252
253     time_str = (char *)time_in.c_str();
254
255     // printf("parse_time(): %s\n", time_str);
256
257     // check for sign
258     if ( strlen(time_str) ) {
259         if ( time_str[0] == '+' ) {
260             sign = 1;
261             time_str++;
262         } else if ( time_str[0] == '-' ) {
263             sign = -1;
264             time_str++;
265         }
266     }
267     // printf("sign = %d\n", sign);
268
269     // get hours
270     if ( strlen(time_str) ) {
271         i = 0;
272         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
273             num[i] = time_str[0];
274             time_str++;
275             i++;
276         }
277         if ( time_str[0] == ':' ) {
278             time_str++;
279         }
280         num[i] = '\0';
281         hours = atof(num);
282         // printf("hours = %.2lf\n", hours);
283
284         result += hours;
285     }
286
287     // get minutes
288     if ( strlen(time_str) ) {
289         i = 0;
290         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
291             num[i] = time_str[0];
292             time_str++;
293             i++;
294         }
295         if ( time_str[0] == ':' ) {
296             time_str++;
297         }
298         num[i] = '\0';
299         minutes = atof(num);
300         // printf("minutes = %.2lf\n", minutes);
301
302         result += minutes / 60.0;
303     }
304
305     // get seconds
306     if ( strlen(time_str) ) {
307         i = 0;
308         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
309             num[i] = time_str[0];
310             time_str++;
311             i++;
312         }
313         num[i] = '\0';
314         seconds = atof(num);
315         // printf("seconds = %.2lf\n", seconds);
316
317         result += seconds / 3600.0;
318     }
319
320     return(sign * result);
321 }
322
323
324 long int fgOPTIONS::parse_date( const string& date)
325 {
326     struct tm gmt;
327     char * date_str, num[256];
328     int i;
329     // initialize to zero
330     gmt.tm_sec = 0;
331     gmt.tm_min = 0;
332     gmt.tm_hour = 0;
333     gmt.tm_mday = 0;
334     gmt.tm_mon = 0;
335     gmt.tm_year = 0;
336     gmt.tm_isdst = 0; // ignore daylight savingtime for the moment
337     date_str = (char *)date.c_str();
338     // get year
339     if ( strlen(date_str) ) {
340         i = 0;
341         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
342             num[i] = date_str[0];
343             date_str++;
344             i++;
345         }
346         if ( date_str[0] == ':' ) {
347             date_str++;
348         }
349         num[i] = '\0';
350         gmt.tm_year = atoi(num) - 1900;
351     }
352     // get month
353     if ( strlen(date_str) ) {
354         i = 0;
355         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
356             num[i] = date_str[0];
357             date_str++;
358             i++;
359         }
360         if ( date_str[0] == ':' ) {
361             date_str++;
362         }
363         num[i] = '\0';
364         gmt.tm_mon = atoi(num) -1;
365     }
366     // get day
367     if ( strlen(date_str) ) {
368         i = 0;
369         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
370             num[i] = date_str[0];
371             date_str++;
372             i++;
373         }
374         if ( date_str[0] == ':' ) {
375             date_str++;
376         }
377         num[i] = '\0';
378         gmt.tm_mday = atoi(num);
379     }
380     // get hour
381     if ( strlen(date_str) ) {
382         i = 0;
383         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
384             num[i] = date_str[0];
385             date_str++;
386             i++;
387         }
388         if ( date_str[0] == ':' ) {
389             date_str++;
390         }
391         num[i] = '\0';
392         gmt.tm_hour = atoi(num);
393     }
394     // get minute
395     if ( strlen(date_str) ) {
396         i = 0;
397         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
398             num[i] = date_str[0];
399             date_str++;
400             i++;
401         }
402         if ( date_str[0] == ':' ) {
403             date_str++;
404         }
405         num[i] = '\0';
406         gmt.tm_min = atoi(num);
407     }
408     // get second
409     if ( strlen(date_str) ) {
410         i = 0;
411         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
412             num[i] = date_str[0];
413             date_str++;
414             i++;
415         }
416         if ( date_str[0] == ':' ) {
417             date_str++;
418         }
419         num[i] = '\0';
420         gmt.tm_sec = atoi(num);
421     }
422     time_t theTime = FGTime::cur_time_params->get_gmt(gmt.tm_year,
423                                                       gmt.tm_mon,
424                                                       gmt.tm_mday,
425                                                       gmt.tm_hour,
426                                                       gmt.tm_min,
427                                                       gmt.tm_sec);
428     //printf ("Date is %s\n", ctime(&theTime));
429     //printf ("in seconds that is %d\n", theTime);
430     //exit(1);
431     return (theTime);
432 }
433
434
435 // parse degree in the form of [+/-]hhh:mm:ss
436 double
437 fgOPTIONS::parse_degree( const string& degree_str) {
438     double result = parse_time( degree_str );
439
440     // printf("Degree = %.4f\n", result);
441
442     return(result);
443 }
444
445
446 // parse time offset command line option
447 int
448 fgOPTIONS::parse_time_offset( const string& time_str) {
449     int result;
450
451     // printf("time offset = %s\n", time_str);
452
453 #ifdef HAVE_RINT
454     result = (int)rint(parse_time(time_str) * 3600.0);
455 #else
456     result = (int)(parse_time(time_str) * 3600.0);
457 #endif
458
459     // printf("parse_time_offset(): %d\n", result);
460
461     return( result );
462 }
463
464
465 // Parse --tile-diameter=n type option 
466
467 int
468 fgOPTIONS::parse_tile_radius( const string& arg ) {
469     int radius = atoi( arg );
470
471     if ( radius < FG_RADIUS_MIN ) { radius = FG_RADIUS_MIN; }
472     if ( radius > FG_RADIUS_MAX ) { radius = FG_RADIUS_MAX; }
473
474     // printf("parse_tile_radius(): radius = %d\n", radius);
475
476     return(radius);
477 }
478
479
480 // Parse --fdm=abcdefg type option 
481 int
482 fgOPTIONS::parse_fdm( const string& fm ) {
483     // printf("fdm = %s\n", fm);
484
485     if ( fm == "slew" ) {
486         return FGInterface::FG_SLEW;
487     } else if ( fm == "jsb" ) {
488         return FGInterface::FG_JSBSIM;
489     } else if ( (fm == "larcsim") || (fm == "LaRCsim") ) {
490         return FGInterface::FG_LARCSIM;
491     } else if ( fm == "external" ) {
492         return FGInterface::FG_EXTERNAL;
493     } else {
494         FG_LOG( FG_GENERAL, FG_ALERT, "Unknown fdm = " << fm );
495         exit(-1);
496     }
497
498     // we'll never get here, but it makes the compiler happy.
499     return -1;
500 }
501
502
503 // Parse --fov=x.xx type option 
504 double
505 fgOPTIONS::parse_fov( const string& arg ) {
506     double fov = atof(arg);
507
508     if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
509     if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
510
511     // printf("parse_fov(): result = %.4f\n", fov);
512
513     return(fov);
514 }
515
516
517 // Parse serial port option --serial=/dev/ttyS1,nmea,4800,out
518 //
519 // Format is "--serial=device,format,baud,direction" where
520 // 
521 //  device = OS device name to be open()'ed
522 //  format = {nmea, garmin,fgfs,rul}
523 //  baud = {300, 1200, 2400, ..., 230400}
524 //  direction = {in, out, bi}
525
526 bool 
527 fgOPTIONS::parse_serial( const string& serial_str ) {
528     string::size_type pos;
529
530     // cout << "Serial string = " << serial_str << endl;
531
532     // a flailing attempt to see if the port config string has a
533     // chance at being valid
534     pos = serial_str.find(",");
535     if ( pos == string::npos ) {
536         FG_LOG( FG_GENERAL, FG_ALERT, 
537                 "Malformed serial port configure string" );
538         return false;
539     }
540     
541     port_options_list.push_back( serial_str );
542
543     return true;
544 }
545
546
547 // Parse a single option
548 int fgOPTIONS::parse_option( const string& arg ) {
549     // General Options
550     if ( (arg == "--help") || (arg == "-h") ) {
551         // help/usage request
552         return(FG_OPTIONS_HELP);
553     } else if ( arg == "--disable-game-mode") {
554         game_mode = false;
555     } else if ( arg == "--enable-game-mode" ) {
556         game_mode = true;
557     } else if ( arg == "--disable-splash-screen" ) {
558         splash_screen = false;
559     } else if ( arg == "--enable-splash-screen" ) {
560         splash_screen = true;
561     } else if ( arg == "--disable-intro-music" ) {
562         intro_music = false;
563     } else if ( arg == "--enable-intro-music" ) {
564         intro_music = true;
565     } else if ( arg == "--disable-mouse-pointer" ) {
566         mouse_pointer = 1;
567     } else if ( arg == "--enable-mouse-pointer" ) {
568         mouse_pointer = 2;
569     } else if ( arg == "--disable-pause" ) {
570         pause = false;  
571     } else if ( arg == "--enable-pause" ) {
572         pause = true;   
573     } else if ( arg == "--disable-hud" ) {
574         hud_status = false;     
575     } else if ( arg == "--enable-hud" ) {
576         hud_status = true;      
577     } else if ( arg == "--disable-panel" ) {
578         panel_status = false;
579     } else if ( arg == "--enable-panel" ) {
580         panel_status = true;
581         fov *= 0.4232;
582     } else if ( arg == "--disable-sound" ) {
583         sound = false;
584     } else if ( arg == "--enable-sound" ) {
585         sound = true;
586     } else if ( arg.find( "--airport-id=") != string::npos ) {
587         airport_id = arg.substr( 13 );
588     } else if ( arg.find( "--lon=" ) != string::npos ) {
589         lon = parse_degree( arg.substr(6) );
590     } else if ( arg.find( "--lat=" ) != string::npos ) {
591         lat = parse_degree( arg.substr(6) );
592     } else if ( arg.find( "--altitude=" ) != string::npos ) {
593         if ( units == FG_UNITS_FEET ) {
594             altitude = atof( arg.substr(11) ) * FEET_TO_METER;
595         } else {
596             altitude = atof( arg.substr(11) );
597         }
598     } else if ( arg.find( "--uBody=" ) != string::npos ) {
599         if ( units == FG_UNITS_FEET ) {
600             uBody = atof( arg.substr(8) ) * FEET_TO_METER;
601         } else {
602             uBody = atof( arg.substr(8) );
603         }
604     } else if ( arg.find( "--vBody=" ) != string::npos ) {
605         if ( units == FG_UNITS_FEET ) {
606             vBody = atof( arg.substr(8) ) * FEET_TO_METER;
607         } else {
608             vBody = atof( arg.substr(8) );
609         }
610     } else if ( arg.find( "--wBody=" ) != string::npos ) {
611         if ( units == FG_UNITS_FEET ) {
612             wBody = atof( arg.substr(8) ) * FEET_TO_METER;
613         } else {
614             wBody = atof( arg.substr(8) );
615         }
616     } else if ( arg.find( "--heading=" ) != string::npos ) {
617         heading = atof( arg.substr(10) );
618     } else if ( arg.find( "--roll=" ) != string::npos ) {
619         roll = atof( arg.substr(7) );
620     } else if ( arg.find( "--pitch=" ) != string::npos ) {
621         pitch = atof( arg.substr(8) );
622     } else if ( arg.find( "--fg-root=" ) != string::npos ) {
623         fg_root = arg.substr( 10 );
624     } else if ( arg.find( "--fdm=" ) != string::npos ) {
625         flight_model = parse_fdm( arg.substr(6) );
626     } else if ( arg == "--fog-disable" ) {
627         fog = FG_FOG_DISABLED;  
628     } else if ( arg == "--fog-fastest" ) {
629         fog = FG_FOG_FASTEST;   
630     } else if ( arg == "--fog-nicest" ) {
631         fog = FG_FOG_NICEST;    
632     } else if ( arg.find( "--fov=" ) != string::npos ) {
633         fov = parse_fov( arg.substr(6) );
634     } else if ( arg == "--disable-fullscreen" ) {
635         fullscreen = false;     
636     } else if ( arg== "--enable-fullscreen") {
637         fullscreen = true;      
638     } else if ( arg == "--shading-flat") {
639         shading = 0;    
640     } else if ( arg == "--shading-smooth") {
641         shading = 1;    
642     } else if ( arg == "--disable-skyblend") {
643         skyblend = false;       
644     } else if ( arg== "--enable-skyblend" ) {
645         skyblend = true;        
646     } else if ( arg == "--disable-textures" ) {
647         textures = false;       
648     } else if ( arg == "--enable-textures" ) {
649         textures = true;
650     } else if ( arg == "--disable-wireframe" ) {
651         wireframe = false;      
652     } else if ( arg == "--enable-wireframe" ) {
653         wireframe = true;
654     } else if ( arg.find( "--geometry=" ) != string::npos ) {
655         string geometry = arg.substr( 11 );
656         if ( geometry == "640x480" ) {
657             xsize = 640;
658             ysize = 480;
659         } else if ( geometry == "800x600" ) {
660             xsize = 800;
661             ysize = 600;
662         } else if ( geometry == "1024x768" ) {
663             xsize = 1024;
664             ysize = 768;
665         } else {
666             FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry );
667             exit(-1);
668         }
669     } else if ( arg == "--units-feet" ) {
670         units = FG_UNITS_FEET;  
671     } else if ( arg == "--units-meters" ) {
672         units = FG_UNITS_METERS;        
673     } else if ( arg.find( "--tile-radius=" ) != string::npos ) {
674         tile_radius = parse_tile_radius( arg.substr(14) );
675         tile_diameter = tile_radius * 2 + 1;
676     } else if ( arg.find( "--time-offset=" ) != string::npos ) {
677         time_offset = parse_time_offset( (arg.substr(14)) );
678     } else if (arg.find( "--start-date-gmt=") != string::npos ) {
679         start_gst = parse_date( (arg.substr(17)) );
680     } else if (arg.find( "--start-data-lst=") != string::npos ) {
681         start_lst = parse_date( (arg.substr(17)) );
682     } else if ( arg == "--hud-tris" ) {
683         tris_or_culled = 0;     
684     } else if ( arg == "--hud-culled" ) {
685         tris_or_culled = 1;
686     } else if ( arg.find( "--serial=" ) != string::npos ) {
687         parse_serial( arg.substr(9) );
688 #ifdef FG_NETWORK_OLK
689     } else if ( arg == "--net-hud" ) {
690         net_hud_display = 1;    
691     } else if ( arg.find( "--net-id=") != string::npos ) {
692         net_id = arg.substr( 9 );
693 #endif
694     } else {
695         FG_LOG( FG_GENERAL, FG_ALERT, "Unknown option '" << arg << "'" );
696         return FG_OPTIONS_ERROR;
697     }
698     
699     return FG_OPTIONS_OK;
700 }
701
702
703 // Parse the command line options
704 int fgOPTIONS::parse_command_line( int argc, char **argv ) {
705     int i = 1;
706     int result;
707
708     FG_LOG(FG_GENERAL, FG_INFO, "Processing command line arguments");
709
710     while ( i < argc ) {
711         FG_LOG( FG_GENERAL, FG_DEBUG, "argv[" << i << "] = " << argv[i] );
712
713         result = parse_option(argv[i]);
714         if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
715             return(result);
716         }
717
718         i++;
719     }
720     
721     return(FG_OPTIONS_OK);
722 }
723
724
725 // Parse config file options
726 int fgOPTIONS::parse_config_file( const string& path ) {
727     fg_gzifstream in( path );
728     if ( !in )
729         return(FG_OPTIONS_ERROR);
730
731     FG_LOG( FG_GENERAL, FG_INFO, "Processing config file: " << path );
732
733     in >> skipcomment;
734     while ( !in.eof() ) {
735         string line;
736
737 #ifdef GETLINE_NEEDS_TERMINATOR
738         getline( in, line, '\n' );
739 #else
740         getline( in, line );
741 #endif
742
743         if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
744             FG_LOG( FG_GENERAL, FG_ALERT, 
745                     "Config file parse error: " << path << " '" 
746                     << line << "'" );
747             exit(-1);
748         }
749         in >> skipcomment;
750     }
751
752     return FG_OPTIONS_OK;
753 }
754
755
756 // Print usage message
757 void fgOPTIONS::usage ( void ) {
758     printf("Usage: fg [ options ... ]\n");
759     printf("\n");
760
761     printf("General Options:\n");
762     printf("\t--help -h:  print usage\n");
763     printf("\t--fg-root=path:  specify the root path for all the data files\n");
764     printf("\t--disable-game-mode:  disable full-screen game mode\n");
765     printf("\t--enable-game-mode:  enable full-screen game mode\n");
766     printf("\t--disable-splash-screen:  disable splash screen\n");
767     printf("\t--enable-splash-screen:  enable splash screen\n");
768     printf("\t--disable-intro-music:  disable introduction music\n");
769     printf("\t--enable-intro-music:  enable introduction music\n");
770     printf("\t--disable-mouse-pointer:  disable extra mouse pointer\n");
771     printf("\t--enable-mouse-pointer:  enable extra mouse pointer (i.e. for\n");
772     printf("\t\tfull screen voodoo/voodoo-II based cards.)\n");
773     printf("\t--disable-pause:  start out in an active state\n");
774     printf("\t--enable-pause:  start out in a paused state\n");
775     printf("\n");
776
777     printf("Features:\n");
778     printf("\t--disable-hud:  disable heads up display\n");
779     printf("\t--enable-hud:  enable heads up display\n");
780     printf("\t--disable-panel:  disable instrument panel\n");
781     printf("\t--enable-panel:  enable instrumetn panel\n");
782     printf("\t--disable-sound:  disable sound effects\n");
783     printf("\t--enable-sound:  enable sound effects\n");
784     printf("\n");
785  
786     printf("Flight Model:\n");
787     printf("\t--fdm=abcd:  one of slew, jsb, larcsim, or external\n");
788     printf("\n");
789
790     printf("Initial Position and Orientation:\n");
791     printf("\t--airport-id=ABCD:  specify starting postion by airport id\n");
792     printf("\t--lon=degrees:  starting longitude in degrees (west = -)\n");
793     printf("\t--lat=degrees:  starting latitude in degrees (south = -)\n");
794     printf("\t--altitude=feet:  starting altitude in feet\n");
795     printf("\t\t(unless --units-meters specified\n");
796     printf("\t--heading=degrees:  heading (yaw) angle in degress (Psi)\n");
797     printf("\t--roll=degrees:  roll angle in degrees (Phi)\n");
798     printf("\t--pitch=degrees:  pitch angle in degrees (Theta)\n");
799     printf("\t--uBody=feet per second:  velocity along the body X axis\n");
800     printf("\t--vBody=feet per second:  velocity along the body Y axis\n");
801     printf("\t--wBody=feet per second:  velocity along the body Z axis\n");
802     printf("\t\t(unless --units-meters specified\n");
803     printf("\n");
804
805     printf("Rendering Options:\n");
806     printf("\t--fog-disable:  disable fog/haze\n");
807     printf("\t--fog-fastest:  enable fastest fog/haze\n");
808     printf("\t--fog-nicest:  enable nicest fog/haze\n");
809     printf("\t--fov=xx.x:  specify initial field of view angle in degrees\n");
810     printf("\t--disable-fullscreen:  disable fullscreen mode\n");
811     printf("\t--enable-fullscreen:  enable fullscreen mode\n");
812     printf("\t--shading-flat:  enable flat shading\n");
813     printf("\t--shading-smooth:  enable smooth shading\n");
814     printf("\t--disable-skyblend:  disable sky blending\n");
815     printf("\t--enable-skyblend:  enable sky blending\n");
816     printf("\t--disable-textures:  disable textures\n");
817     printf("\t--enable-textures:  enable textures\n");
818     printf("\t--disable-wireframe:  disable wireframe drawing mode\n");
819     printf("\t--enable-wireframe:  enable wireframe drawing mode\n");
820     printf("\t--geometry=WWWxHHH:  window geometry: 640x480, 800x600, etc.\n");
821     printf("\n");
822
823     printf("Scenery Options:\n");
824     printf("\t--tile-radius=n:  specify tile radius, must be 1 - 4\n");
825     printf("\n");
826
827     printf("Hud Options:\n");
828     printf("\t--units-feet:  Hud displays units in feet\n");
829     printf("\t--units-meters:  Hud displays units in meters\n");
830     printf("\t--hud-tris:  Hud displays number of triangles rendered\n");
831     printf("\t--hud-culled:  Hud displays percentage of triangles culled\n");
832     printf("\n");
833         
834     printf("Time Options:\n");
835     printf("\t--time-offset=[+-]hh:mm:ss:  offset local time by this amount\n");
836     printf("\t--start-date-gmt=yyyy:mm:dd:hh:mm:ss: specify a starting date/time. Time is Greenwich Mean Time\n");
837     printf("\t--start-date-lst=yyyy:mm:dd:hh:mm:ss: specify a starting date/time. Uses local sidereal time\n");
838 #ifdef FG_NETWORK_OLK
839     printf("\n");
840
841     printf("Network Options:\n");
842     printf("\t--net-hud:  Hud displays network info\n");
843     printf("\t--net-id=name:  specify your own callsign\n");
844 #endif
845 }
846
847
848 // Destructor
849 fgOPTIONS::~fgOPTIONS( void ) {
850 }