]> git.mxchange.org Git - flightgear.git/blob - src/Main/options.cxx
Network updates contributed by Oliver Delise.
[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     // Initial Orientation
142     heading(270.0),      // heading (yaw) angle in degress (Psi)
143     roll(0.0),           // roll angle in degrees (Phi)
144     pitch(0.424),        // pitch angle in degrees (Theta)
145
146     // Miscellaneous
147     game_mode(0),
148     splash_screen(1),
149     intro_music(1),
150     mouse_pointer(0),
151     pause(0),
152
153     // Features
154     hud_status(1),
155     panel_status(0),
156     sound(1),
157
158     // Flight Model options
159     flight_model(FGInterface::FG_LARCSIM),
160
161     // Rendering options
162     fog(FG_FOG_NICEST),  // nicest
163     fov(55.0),
164     fullscreen(0),
165     shading(1),
166     skyblend(1),
167     textures(1),
168     wireframe(0),
169     xsize(640),
170     ysize(480),
171
172     // Scenery options
173     tile_diameter(5),
174
175     // HUD options
176     units(FG_UNITS_FEET),
177     tris_or_culled(0),
178         
179     // Time options
180     time_offset(0),
181     start_gst(0),
182     start_lst(0)
183
184 {
185     // set initial values/defaults
186     char* envp = ::getenv( "FG_ROOT" );
187
188     if ( envp != NULL ) {
189         // fg_root could be anywhere, so default to environmental
190         // variable $FG_ROOT if it is set.
191         fg_root = envp;
192     } else {
193         // Otherwise, default to a random compiled in location if
194         // $FG_ROOT is not set.  This can still be overridden from the
195         // command line or a config file.
196
197 #if defined( WIN32 )
198         fg_root = "\\FlightGear";
199 #elif defined( MACOS )
200         fg_root = "";
201 #else
202         fg_root = PKGLIBDIR;
203 #endif
204     }
205
206     airport_id = "";            // default airport id
207     net_id = "Johnney";         // default pilot's name
208
209     // initialize port config string list
210     port_options_list.erase ( port_options_list.begin(), 
211                               port_options_list.end() );
212 }
213
214 void 
215 fgOPTIONS::toggle_panel() {
216     
217     FGTime *t = FGTime::cur_time_params;
218     
219     int toggle_pause = t->getPause();
220     
221     if( !toggle_pause )
222         t->togglePauseMode();
223     
224     if( panel_status ) {
225         panel_status = false;
226     } else {
227         panel_status = true;
228     }
229     if ( panel_status ) {
230         if( FGPanel::OurPanel == 0)
231             new FGPanel;
232         fov *= 0.4232;
233     } else {
234         fov *= (1.0 / 0.4232);
235     }
236     fgReshape( xsize, ysize);
237     
238     if( !toggle_pause )
239         t->togglePauseMode();
240 }
241
242 double
243 fgOPTIONS::parse_time(const string& time_in) {
244     char *time_str, num[256];
245     double hours, minutes, seconds;
246     double result = 0.0;
247     int sign = 1;
248     int i;
249
250     time_str = (char *)time_in.c_str();
251
252     // printf("parse_time(): %s\n", time_str);
253
254     // check for sign
255     if ( strlen(time_str) ) {
256         if ( time_str[0] == '+' ) {
257             sign = 1;
258             time_str++;
259         } else if ( time_str[0] == '-' ) {
260             sign = -1;
261             time_str++;
262         }
263     }
264     // printf("sign = %d\n", sign);
265
266     // get hours
267     if ( strlen(time_str) ) {
268         i = 0;
269         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
270             num[i] = time_str[0];
271             time_str++;
272             i++;
273         }
274         if ( time_str[0] == ':' ) {
275             time_str++;
276         }
277         num[i] = '\0';
278         hours = atof(num);
279         // printf("hours = %.2lf\n", hours);
280
281         result += hours;
282     }
283
284     // get minutes
285     if ( strlen(time_str) ) {
286         i = 0;
287         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
288             num[i] = time_str[0];
289             time_str++;
290             i++;
291         }
292         if ( time_str[0] == ':' ) {
293             time_str++;
294         }
295         num[i] = '\0';
296         minutes = atof(num);
297         // printf("minutes = %.2lf\n", minutes);
298
299         result += minutes / 60.0;
300     }
301
302     // get seconds
303     if ( strlen(time_str) ) {
304         i = 0;
305         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
306             num[i] = time_str[0];
307             time_str++;
308             i++;
309         }
310         num[i] = '\0';
311         seconds = atof(num);
312         // printf("seconds = %.2lf\n", seconds);
313
314         result += seconds / 3600.0;
315     }
316
317     return(sign * result);
318 }
319
320
321 long int fgOPTIONS::parse_date( const string& date)
322 {
323     struct tm gmt;
324     char * date_str, num[256];
325     int i;
326     // initialize to zero
327     gmt.tm_sec = 0;
328     gmt.tm_min = 0;
329     gmt.tm_hour = 0;
330     gmt.tm_mday = 0;
331     gmt.tm_mon = 0;
332     gmt.tm_year = 0;
333     gmt.tm_isdst = 0; // ignore daylight savingtime for the moment
334     date_str = (char *)date.c_str();
335     // get year
336     if ( strlen(date_str) ) {
337         i = 0;
338         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
339             num[i] = date_str[0];
340             date_str++;
341             i++;
342         }
343         if ( date_str[0] == ':' ) {
344             date_str++;
345         }
346         num[i] = '\0';
347         gmt.tm_year = atoi(num) - 1900;
348     }
349     // get month
350     if ( strlen(date_str) ) {
351         i = 0;
352         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
353             num[i] = date_str[0];
354             date_str++;
355             i++;
356         }
357         if ( date_str[0] == ':' ) {
358             date_str++;
359         }
360         num[i] = '\0';
361         gmt.tm_mon = atoi(num) -1;
362     }
363     // get day
364     if ( strlen(date_str) ) {
365         i = 0;
366         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
367             num[i] = date_str[0];
368             date_str++;
369             i++;
370         }
371         if ( date_str[0] == ':' ) {
372             date_str++;
373         }
374         num[i] = '\0';
375         gmt.tm_mday = atoi(num);
376     }
377     // get hour
378     if ( strlen(date_str) ) {
379         i = 0;
380         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
381             num[i] = date_str[0];
382             date_str++;
383             i++;
384         }
385         if ( date_str[0] == ':' ) {
386             date_str++;
387         }
388         num[i] = '\0';
389         gmt.tm_hour = atoi(num);
390     }
391     // get minute
392     if ( strlen(date_str) ) {
393         i = 0;
394         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
395             num[i] = date_str[0];
396             date_str++;
397             i++;
398         }
399         if ( date_str[0] == ':' ) {
400             date_str++;
401         }
402         num[i] = '\0';
403         gmt.tm_min = atoi(num);
404     }
405     // get second
406     if ( strlen(date_str) ) {
407         i = 0;
408         while ( (date_str[0] != ':') && (date_str[0] != '\0') ) {
409             num[i] = date_str[0];
410             date_str++;
411             i++;
412         }
413         if ( date_str[0] == ':' ) {
414             date_str++;
415         }
416         num[i] = '\0';
417         gmt.tm_sec = atoi(num);
418     }
419     time_t theTime = FGTime::cur_time_params->get_gmt(gmt.tm_year,
420                                                       gmt.tm_mon,
421                                                       gmt.tm_mday,
422                                                       gmt.tm_hour,
423                                                       gmt.tm_min,
424                                                       gmt.tm_sec);
425     //printf ("Date is %s\n", ctime(&theTime));
426     //printf ("in seconds that is %d\n", theTime);
427     //exit(1);
428     return (theTime);
429 }
430
431
432 // parse degree in the form of [+/-]hhh:mm:ss
433 double
434 fgOPTIONS::parse_degree( const string& degree_str) {
435     double result = parse_time( degree_str );
436
437     // printf("Degree = %.4f\n", result);
438
439     return(result);
440 }
441
442
443 // parse time offset command line option
444 int
445 fgOPTIONS::parse_time_offset( const string& time_str) {
446     int result;
447
448     // printf("time offset = %s\n", time_str);
449
450 #ifdef HAVE_RINT
451     result = (int)rint(parse_time(time_str) * 3600.0);
452 #else
453     result = (int)(parse_time(time_str) * 3600.0);
454 #endif
455
456     // printf("parse_time_offset(): %d\n", result);
457
458     return( result );
459 }
460
461
462 // Parse --tile-diameter=n type option 
463
464 int
465 fgOPTIONS::parse_tile_radius( const string& arg ) {
466     int radius = atoi( arg );
467
468     if ( radius < FG_RADIUS_MIN ) { radius = FG_RADIUS_MIN; }
469     if ( radius > FG_RADIUS_MAX ) { radius = FG_RADIUS_MAX; }
470
471     // printf("parse_tile_radius(): radius = %d\n", radius);
472
473     return(radius);
474 }
475
476
477 // Parse --fdm=abcdefg type option 
478 int
479 fgOPTIONS::parse_fdm( const string& fm ) {
480     // printf("fdm = %s\n", fm);
481
482     if ( fm == "slew" ) {
483         return FGInterface::FG_SLEW;
484     } else if ( fm == "jsb" ) {
485         return FGInterface::FG_JSBSIM;
486     } else if ( (fm == "larcsim") || (fm == "LaRCsim") ) {
487         return FGInterface::FG_LARCSIM;
488     } else if ( fm == "external" ) {
489         return FGInterface::FG_EXTERNAL;
490     } else {
491         FG_LOG( FG_GENERAL, FG_ALERT, "Unknown fdm = " << fm );
492         exit(-1);
493     }
494
495     // we'll never get here, but it makes the compiler happy.
496     return -1;
497 }
498
499
500 // Parse --fov=x.xx type option 
501 double
502 fgOPTIONS::parse_fov( const string& arg ) {
503     double fov = atof(arg);
504
505     if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
506     if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
507
508     // printf("parse_fov(): result = %.4f\n", fov);
509
510     return(fov);
511 }
512
513
514 // Parse serial port option --serial=/dev/ttyS1,nmea,4800,out
515 //
516 // Format is "--serial=device,format,baud,direction" where
517 // 
518 //  device = OS device name to be open()'ed
519 //  format = {nmea, garmin,fgfs,rul}
520 //  baud = {300, 1200, 2400, ..., 230400}
521 //  direction = {in, out, bi}
522
523 bool 
524 fgOPTIONS::parse_serial( const string& serial_str ) {
525     string::size_type pos;
526
527     // cout << "Serial string = " << serial_str << endl;
528
529     // a flailing attempt to see if the port config string has a
530     // chance at being valid
531     pos = serial_str.find(",");
532     if ( pos == string::npos ) {
533         FG_LOG( FG_GENERAL, FG_ALERT, 
534                 "Malformed serial port configure string" );
535         return false;
536     }
537     
538     port_options_list.push_back( serial_str );
539
540     return true;
541 }
542
543
544 // Parse a single option
545 int fgOPTIONS::parse_option( const string& arg ) {
546     // General Options
547     if ( (arg == "--help") || (arg == "-h") ) {
548         // help/usage request
549         return(FG_OPTIONS_HELP);
550     } else if ( arg == "--disable-game-mode") {
551         game_mode = false;
552     } else if ( arg == "--enable-game-mode" ) {
553         game_mode = true;
554     } else if ( arg == "--disable-splash-screen" ) {
555         splash_screen = false;
556     } else if ( arg == "--enable-splash-screen" ) {
557         splash_screen = true;
558     } else if ( arg == "--disable-intro-music" ) {
559         intro_music = false;
560     } else if ( arg == "--enable-intro-music" ) {
561         intro_music = true;
562     } else if ( arg == "--disable-mouse-pointer" ) {
563         mouse_pointer = 1;
564     } else if ( arg == "--enable-mouse-pointer" ) {
565         mouse_pointer = 2;
566     } else if ( arg == "--disable-pause" ) {
567         pause = false;  
568     } else if ( arg == "--enable-pause" ) {
569         pause = true;   
570     } else if ( arg == "--disable-hud" ) {
571         hud_status = false;     
572     } else if ( arg == "--enable-hud" ) {
573         hud_status = true;      
574     } else if ( arg == "--disable-panel" ) {
575         panel_status = false;
576     } else if ( arg == "--enable-panel" ) {
577         panel_status = true;
578         fov *= 0.4232;
579     } else if ( arg == "--disable-sound" ) {
580         sound = false;
581     } else if ( arg == "--enable-sound" ) {
582         sound = true;
583     } else if ( arg.find( "--airport-id=") != string::npos ) {
584         airport_id = arg.substr( 13 );
585     } else if ( arg.find( "--lon=" ) != string::npos ) {
586         lon = parse_degree( arg.substr(6) );
587     } else if ( arg.find( "--lat=" ) != string::npos ) {
588         lat = parse_degree( arg.substr(6) );
589     } else if ( arg.find( "--altitude=" ) != string::npos ) {
590         if ( units == FG_UNITS_FEET ) {
591             altitude = atof( arg.substr(11) ) * FEET_TO_METER;
592         } else {
593             altitude = atof( arg.substr(11) );
594         }
595     } else if ( arg.find( "--heading=" ) != string::npos ) {
596         heading = atof( arg.substr(10) );
597     } else if ( arg.find( "--roll=" ) != string::npos ) {
598         roll = atof( arg.substr(7) );
599     } else if ( arg.find( "--pitch=" ) != string::npos ) {
600         pitch = atof( arg.substr(8) );
601     } else if ( arg.find( "--fg-root=" ) != string::npos ) {
602         fg_root = arg.substr( 10 );
603     } else if ( arg.find( "--fdm=" ) != string::npos ) {
604         flight_model = parse_fdm( arg.substr(6) );
605     } else if ( arg == "--fog-disable" ) {
606         fog = FG_FOG_DISABLED;  
607     } else if ( arg == "--fog-fastest" ) {
608         fog = FG_FOG_FASTEST;   
609     } else if ( arg == "--fog-nicest" ) {
610         fog = FG_FOG_NICEST;    
611     } else if ( arg.find( "--fov=" ) != string::npos ) {
612         fov = parse_fov( arg.substr(6) );
613     } else if ( arg == "--disable-fullscreen" ) {
614         fullscreen = false;     
615     } else if ( arg== "--enable-fullscreen") {
616         fullscreen = true;      
617     } else if ( arg == "--shading-flat") {
618         shading = 0;    
619     } else if ( arg == "--shading-smooth") {
620         shading = 1;    
621     } else if ( arg == "--disable-skyblend") {
622         skyblend = false;       
623     } else if ( arg== "--enable-skyblend" ) {
624         skyblend = true;        
625     } else if ( arg == "--disable-textures" ) {
626         textures = false;       
627     } else if ( arg == "--enable-textures" ) {
628         textures = true;
629     } else if ( arg == "--disable-wireframe" ) {
630         wireframe = false;      
631     } else if ( arg == "--enable-wireframe" ) {
632         wireframe = true;
633     } else if ( arg.find( "--geometry=" ) != string::npos ) {
634         string geometry = arg.substr( 11 );
635         if ( geometry == "640x480" ) {
636             xsize = 640;
637             ysize = 480;
638         } else if ( geometry == "800x600" ) {
639             xsize = 800;
640             ysize = 600;
641         } else if ( geometry == "1024x768" ) {
642             xsize = 1024;
643             ysize = 768;
644         } else {
645             FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry );
646             exit(-1);
647         }
648     } else if ( arg == "--units-feet" ) {
649         units = FG_UNITS_FEET;  
650     } else if ( arg == "--units-meters" ) {
651         units = FG_UNITS_METERS;        
652     } else if ( arg.find( "--tile-radius=" ) != string::npos ) {
653         tile_radius = parse_tile_radius( arg.substr(14) );
654         tile_diameter = tile_radius * 2 + 1;
655     } else if ( arg.find( "--time-offset=" ) != string::npos ) {
656         time_offset = parse_time_offset( (arg.substr(14)) );
657     } else if (arg.find( "--start-date-gmt=") != string::npos ) {
658         start_gst = parse_date( (arg.substr(17)) );
659     } else if (arg.find( "--start-data-lst=") != string::npos ) {
660         start_lst = parse_date( (arg.substr(17)) );
661     } else if ( arg == "--hud-tris" ) {
662         tris_or_culled = 0;     
663     } else if ( arg == "--hud-culled" ) {
664         tris_or_culled = 1;
665     } else if ( arg.find( "--serial=" ) != string::npos ) {
666         parse_serial( arg.substr(9) );
667 #ifdef FG_NETWORK_OLK
668     } else if ( arg == "--net-hud" ) {
669         net_hud_display = 1;    
670     } else if ( arg.find( "--net-id=") != string::npos ) {
671         net_id = arg.substr( 9 );
672 #endif
673     } else {
674         FG_LOG( FG_GENERAL, FG_ALERT, "Unknown option '" << arg << "'" );
675         return FG_OPTIONS_ERROR;
676     }
677     
678     return FG_OPTIONS_OK;
679 }
680
681
682 // Parse the command line options
683 int fgOPTIONS::parse_command_line( int argc, char **argv ) {
684     int i = 1;
685     int result;
686
687     FG_LOG(FG_GENERAL, FG_INFO, "Processing command line arguments");
688
689     while ( i < argc ) {
690         FG_LOG( FG_GENERAL, FG_DEBUG, "argv[" << i << "] = " << argv[i] );
691
692         result = parse_option(argv[i]);
693         if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
694             return(result);
695         }
696
697         i++;
698     }
699     
700     return(FG_OPTIONS_OK);
701 }
702
703
704 // Parse config file options
705 int fgOPTIONS::parse_config_file( const string& path ) {
706     fg_gzifstream in( path );
707     if ( !in )
708         return(FG_OPTIONS_ERROR);
709
710     FG_LOG( FG_GENERAL, FG_INFO, "Processing config file: " << path );
711
712     in >> skipcomment;
713     while ( !in.eof() ) {
714         string line;
715
716 #ifdef GETLINE_NEEDS_TERMINATOR
717         getline( in, line, '\n' );
718 #else
719         getline( in, line );
720 #endif
721
722         if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
723             FG_LOG( FG_GENERAL, FG_ALERT, 
724                     "Config file parse error: " << path << " '" 
725                     << line << "'" );
726             exit(-1);
727         }
728         in >> skipcomment;
729     }
730
731     return FG_OPTIONS_OK;
732 }
733
734
735 // Print usage message
736 void fgOPTIONS::usage ( void ) {
737     printf("Usage: fg [ options ... ]\n");
738     printf("\n");
739
740     printf("General Options:\n");
741     printf("\t--help -h:  print usage\n");
742     printf("\t--fg-root=path:  specify the root path for all the data files\n");
743     printf("\t--disable-game-mode:  disable full-screen game mode\n");
744     printf("\t--enable-game-mode:  enable full-screen game mode\n");
745     printf("\t--disable-splash-screen:  disable splash screen\n");
746     printf("\t--enable-splash-screen:  enable splash screen\n");
747     printf("\t--disable-intro-music:  disable introduction music\n");
748     printf("\t--enable-intro-music:  enable introduction music\n");
749     printf("\t--disable-mouse-pointer:  disable extra mouse pointer\n");
750     printf("\t--enable-mouse-pointer:  enable extra mouse pointer (i.e. for\n");
751     printf("\t\tfull screen voodoo/voodoo-II based cards.)\n");
752     printf("\t--disable-pause:  start out in an active state\n");
753     printf("\t--enable-pause:  start out in a paused state\n");
754     printf("\n");
755
756     printf("Features:\n");
757     printf("\t--disable-hud:  disable heads up display\n");
758     printf("\t--enable-hud:  enable heads up display\n");
759     printf("\t--disable-panel:  disable instrument panel\n");
760     printf("\t--enable-panel:  enable instrumetn panel\n");
761     printf("\t--disable-sound:  disable sound effects\n");
762     printf("\t--enable-sound:  enable sound effects\n");
763     printf("\n");
764  
765     printf("Flight Model:\n");
766     printf("\t--fdm=abcd:  one of slew, jsb, larcsim, or external\n");
767     printf("\n");
768
769     printf("Initial Position and Orientation:\n");
770     printf("\t--airport-id=ABCD:  specify starting postion by airport id\n");
771     printf("\t--lon=degrees:  starting longitude in degrees (west = -)\n");
772     printf("\t--lat=degrees:  starting latitude in degrees (south = -)\n");
773     printf("\t--altitude=feet:  starting altitude in feet\n");
774     printf("\t\t(unless --units-meters specified\n");
775     printf("\t--heading=degrees:  heading (yaw) angle in degress (Psi)\n");
776     printf("\t--roll=degrees:  roll angle in degrees (Phi)\n");
777     printf("\t--pitch=degrees:  pitch angle in degrees (Theta)\n");
778     printf("\n");
779
780     printf("Rendering Options:\n");
781     printf("\t--fog-disable:  disable fog/haze\n");
782     printf("\t--fog-fastest:  enable fastest fog/haze\n");
783     printf("\t--fog-nicest:  enable nicest fog/haze\n");
784     printf("\t--fov=xx.x:  specify initial field of view angle in degrees\n");
785     printf("\t--disable-fullscreen:  disable fullscreen mode\n");
786     printf("\t--enable-fullscreen:  enable fullscreen mode\n");
787     printf("\t--shading-flat:  enable flat shading\n");
788     printf("\t--shading-smooth:  enable smooth shading\n");
789     printf("\t--disable-skyblend:  disable sky blending\n");
790     printf("\t--enable-skyblend:  enable sky blending\n");
791     printf("\t--disable-textures:  disable textures\n");
792     printf("\t--enable-textures:  enable textures\n");
793     printf("\t--disable-wireframe:  disable wireframe drawing mode\n");
794     printf("\t--enable-wireframe:  enable wireframe drawing mode\n");
795     printf("\t--geometry=WWWxHHH:  window geometry: 640x480, 800x600, etc.\n");
796     printf("\n");
797
798     printf("Scenery Options:\n");
799     printf("\t--tile-radius=n:  specify tile radius, must be 1 - 4\n");
800     printf("\n");
801
802     printf("Hud Options:\n");
803     printf("\t--units-feet:  Hud displays units in feet\n");
804     printf("\t--units-meters:  Hud displays units in meters\n");
805     printf("\t--hud-tris:  Hud displays number of triangles rendered\n");
806     printf("\t--hud-culled:  Hud displays percentage of triangles culled\n");
807     printf("\n");
808         
809     printf("Time Options:\n");
810     printf("\t--time-offset=[+-]hh:mm:ss:  offset local time by this amount\n");
811     printf("\t--start-date-gmt=yyyy:mm:dd:hh:mm:ss: specify a starting date/time. Time is Greenwich Mean Time\n");
812     printf("\t--start-date-lst=yyyy:mm:dd:hh:mm:ss: specify a starting date/time. Uses local sidereal time\n");
813 #ifdef FG_NETWORK_OLK
814     printf("\n");
815
816     printf("Network Options:\n");
817     printf("\t--net-hud:  Hud displays network info\n");
818     printf("\t--net-id=name:  specify your own callsign\n");
819 #endif
820 }
821
822
823 // Destructor
824 fgOPTIONS::~fgOPTIONS( void ) {
825 }