]> git.mxchange.org Git - flightgear.git/blob - Main/options.cxx
Support for an arbitrary number of serial ports.
[flightgear.git] / Main / options.cxx
1 //
2 // options.cxx -- class to handle command line options
3 //
4 // Written by Curtis Olson, started April 1998.
5 //
6 // Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 //
22 // $Id$
23 // (Log is kept at end of this file)
24
25
26 #ifdef HAVE_CONFIG_H
27 #  include <config.h>
28 #endif
29
30 #include <math.h>            // rint()
31 #include <stdio.h>
32 #include <stdlib.h>          // atof(), atoi()
33 #include <string.h>
34 #include <string>
35
36 #include <Debug/logstream.hxx>
37 #include <Flight/flight.hxx>
38 #include <Include/fg_constants.h>
39 #include <Main/options.hxx>
40 #include <Misc/fgstream.hxx>
41
42 #include "fg_serial.hxx"
43
44
45 inline double
46 atof( const string& str )
47 {
48     return ::atof( str.c_str() );
49 }
50
51 inline int
52 atoi( const string& str )
53 {
54     return ::atoi( str.c_str() );
55 }
56
57 // Defined the shared options class here
58 fgOPTIONS current_options;
59
60
61 // Constructor
62 fgOPTIONS::fgOPTIONS() :
63     // starting longitude in degrees (west = -)
64     // starting latitude in degrees (south = -)
65
66     // Default initial position is Globe, AZ (P13)
67     lon(-110.6642444),
68     lat(  33.3528917),
69
70     // North of the city of Globe
71     // lon(-110.7),
72     // lat(  33.4),
73
74     // North of the city of Globe
75     // lon(-110.742578),
76     // lat(  33.507122),
77
78     // Near where I used to live in Globe, AZ
79     // lon(-110.766000),
80     // lat(  33.377778),
81
82     // 10125 Jewell St. NE
83     // lon(-93.15),
84     // lat( 45.15),
85
86     // Near KHSP (Hot Springs, VA)
87     // lon(-79.8338964 + 0.01),
88     // lat( 37.9514564 + 0.008),
89
90     // (SEZ) SEDONA airport
91     // lon(-111.7884614 + 0.01),
92     // lat(  34.8486289 - 0.015),
93
94     // Jim Brennon's Kingmont Observatory
95     // lon(-121.1131667),
96     // lat(  38.8293917),
97
98     // Huaras, Peru (S09d 31.871'  W077d 31.498')
99     // lon(-77.5249667),
100     // lat( -9.5311833),
101  
102     // Eclipse Watching w73.5 n10 (approx) 18:00 UT
103     // lon(-73.5),
104     // lat( 10.0),
105
106     // Timms Hill (WI)
107     // lon(-90.1953055556),
108     // lat( 45.4511388889),
109
110     // starting altitude in meters (this will be reset to ground level
111     // if it is lower than the terrain
112     altitude(-9999.0),
113
114     // Initial Orientation
115     heading(270.0),      // heading (yaw) angle in degress (Psi)
116     roll(0.0),           // roll angle in degrees (Phi)
117     pitch(0.424),        // pitch angle in degrees (Theta)
118
119     // Miscellaneous
120     game_mode(0),
121     splash_screen(1),
122     intro_music(1),
123     mouse_pointer(0),
124     pause(0),
125
126     // Features
127     hud_status(1),
128     panel_status(0),
129     sound(1),
130
131     // Flight Model options
132     flight_model(FG_LARCSIM),
133
134     // Rendering options
135     fog(FG_FOG_NICEST),  // nicest
136     fov(55.0),
137     fullscreen(0),
138     shading(1),
139     skyblend(1),
140     textures(1),
141     wireframe(0),
142     xsize(640),
143     ysize(480),
144
145     // Scenery options
146     tile_diameter(5),
147
148     // HUD options
149     units(FG_UNITS_FEET),
150     tris_or_culled(0),
151         
152     // Time options
153     time_offset(0)
154
155 {
156     // set initial values/defaults
157     char* envp = ::getenv( "FG_ROOT" );
158
159     if ( envp != NULL ) {
160         // fg_root could be anywhere, so default to environmental
161         // variable $FG_ROOT if it is set.
162         fg_root = envp;
163     } else {
164         // Otherwise, default to a random compiled in location if
165         // $FG_ROOT is not set.  This can still be overridden from the
166         // command line or a config file.
167
168 #if defined(WIN32)
169         fg_root = "\\FlightGear";
170 #else
171         fg_root = "/usr/local/lib/FlightGear";
172 #endif
173     }
174
175     airport_id = "";  // default airport id
176
177     // initialize port config string list
178     port_options_list.erase ( port_options_list.begin(), 
179                               port_options_list.end() );
180 }
181
182
183 double
184 fgOPTIONS::parse_time(const string& time_in) {
185     char *time_str, num[256];
186     double hours, minutes, seconds;
187     double result = 0.0;
188     int sign = 1;
189     int i;
190
191     time_str = (char *)time_in.c_str();
192
193     // printf("parse_time(): %s\n", time_str);
194
195     // check for sign
196     if ( strlen(time_str) ) {
197         if ( time_str[0] == '+' ) {
198             sign = 1;
199             time_str++;
200         } else if ( time_str[0] == '-' ) {
201             sign = -1;
202             time_str++;
203         }
204     }
205     // printf("sign = %d\n", sign);
206
207     // get hours
208     if ( strlen(time_str) ) {
209         i = 0;
210         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
211             num[i] = time_str[0];
212             time_str++;
213             i++;
214         }
215         if ( time_str[0] == ':' ) {
216             time_str++;
217         }
218         num[i] = '\0';
219         hours = atof(num);
220         // printf("hours = %.2lf\n", hours);
221
222         result += hours;
223     }
224
225     // get minutes
226     if ( strlen(time_str) ) {
227         i = 0;
228         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
229             num[i] = time_str[0];
230             time_str++;
231             i++;
232         }
233         if ( time_str[0] == ':' ) {
234             time_str++;
235         }
236         num[i] = '\0';
237         minutes = atof(num);
238         // printf("minutes = %.2lf\n", minutes);
239
240         result += minutes / 60.0;
241     }
242
243     // get seconds
244     if ( strlen(time_str) ) {
245         i = 0;
246         while ( (time_str[0] != ':') && (time_str[0] != '\0') ) {
247             num[i] = time_str[0];
248             time_str++;
249             i++;
250         }
251         num[i] = '\0';
252         seconds = atof(num);
253         // printf("seconds = %.2lf\n", seconds);
254
255         result += seconds / 3600.0;
256     }
257
258     return(sign * result);
259 }
260
261
262 // parse degree in the form of [+/-]hhh:mm:ss
263 double
264 fgOPTIONS::parse_degree( const string& degree_str) {
265     double result = parse_time( degree_str );
266
267     // printf("Degree = %.4f\n", result);
268
269     return(result);
270 }
271
272
273 // parse time offset command line option
274 int
275 fgOPTIONS::parse_time_offset( const string& time_str) {
276     int result;
277
278     // printf("time offset = %s\n", time_str);
279
280 #ifdef HAVE_RINT
281     result = (int)rint(parse_time(time_str) * 3600.0);
282 #else
283     result = (int)(parse_time(time_str) * 3600.0);
284 #endif
285
286     // printf("parse_time_offset(): %d\n", result);
287
288     return( result );
289 }
290
291
292 // Parse --tile-diameter=n type option 
293
294 int
295 fgOPTIONS::parse_tile_radius( const string& arg ) {
296     int radius = atoi( arg );
297
298     if ( radius < FG_RADIUS_MIN ) { radius = FG_RADIUS_MIN; }
299     if ( radius > FG_RADIUS_MAX ) { radius = FG_RADIUS_MAX; }
300
301     // printf("parse_tile_radius(): radius = %d\n", radius);
302
303     return(radius);
304 }
305
306
307 // Parse --flightmode=abcdefg type option 
308 int
309 fgOPTIONS::parse_flight_model( const string& fm ) {
310     // printf("flight model = %s\n", fm);
311
312     if ( fm == "slew" ) {
313         return FG_SLEW;
314     } else if ( (fm == "larcsim") || (fm == "LaRCsim") ) {
315         return FG_LARCSIM;
316     } else {
317         FG_LOG( FG_GENERAL, FG_ALERT, "Unknown flight model = " << fm );
318         exit(-1);
319     }
320
321     // we'll never get here, but it makes the compiler happy.
322     return -1;
323 }
324
325
326 // Parse --fov=x.xx type option 
327 double
328 fgOPTIONS::parse_fov( const string& arg ) {
329     double fov = atof(arg);
330
331     if ( fov < FG_FOV_MIN ) { fov = FG_FOV_MIN; }
332     if ( fov > FG_FOV_MAX ) { fov = FG_FOV_MAX; }
333
334     // printf("parse_fov(): result = %.4f\n", fov);
335
336     return(fov);
337 }
338
339
340 // Parse serial port option --serial=/dev/ttyS1,nmea,4800,out
341 //
342 // Format is "--serial=device,format,baud,direction" where
343 // 
344 //  device = OS device name to be open()'ed
345 //  format = {nmea, fgfs}
346 //  baud = {300, 1200, 2400, ..., 230400}
347 //  direction = {in, out, bi}
348
349 bool 
350 fgOPTIONS::parse_serial( const string& serial_str ) {
351     string::size_type pos;
352
353     // cout << "Serial string = " << serial_str << endl;
354
355     // a flailing attempt to see if the port config string has a
356     // chance at being valid
357     pos = serial_str.find(",");
358     if ( pos == string::npos ) {
359         FG_LOG( FG_GENERAL, FG_ALERT, 
360                 "Malformed serial port configure string" );
361         return false;
362     }
363     
364     port_options_list.push_back( serial_str );
365
366     return true;
367 }
368
369
370 // Parse a single option
371 int fgOPTIONS::parse_option( const string& arg ) {
372     // General Options
373     if ( (arg == "--help") || (arg == "-h") ) {
374         // help/usage request
375         return(FG_OPTIONS_HELP);
376     } else if ( arg == "--disable-game-mode") {
377         game_mode = false;
378     } else if ( arg == "--enable-game-mode" ) {
379         game_mode = true;
380     } else if ( arg == "--disable-splash-screen" ) {
381         splash_screen = false;
382     } else if ( arg == "--enable-splash-screen" ) {
383         splash_screen = true;
384     } else if ( arg == "--disable-intro-music" ) {
385         intro_music = false;
386     } else if ( arg == "--enable-intro-music" ) {
387         intro_music = true;
388     } else if ( arg == "--disable-mouse-pointer" ) {
389         mouse_pointer = 1;
390     } else if ( arg == "--enable-mouse-pointer" ) {
391         mouse_pointer = 2;
392     } else if ( arg == "--disable-pause" ) {
393         pause = false;  
394     } else if ( arg == "--enable-pause" ) {
395         pause = true;   
396     } else if ( arg == "--disable-hud" ) {
397         hud_status = false;     
398     } else if ( arg == "--enable-hud" ) {
399         hud_status = true;      
400     } else if ( arg == "--disable-panel" ) {
401         panel_status = false;
402     } else if ( arg == "--enable-panel" ) {
403         panel_status = true;
404     } else if ( arg == "--disable-sound" ) {
405         sound = false;
406     } else if ( arg == "--enable-sound" ) {
407         sound = true;
408     } else if ( arg.find( "--airport-id=") != string::npos ) {
409         airport_id = arg.substr( 13 );
410     } else if ( arg.find( "--lon=" ) != string::npos ) {
411         lon = parse_degree( arg.substr(6) );
412     } else if ( arg.find( "--lat=" ) != string::npos ) {
413         lat = parse_degree( arg.substr(6) );
414     } else if ( arg.find( "--altitude=" ) != string::npos ) {
415         altitude = atof( arg.substr(11) );
416     } else if ( arg.find( "--heading=" ) != string::npos ) {
417         heading = atof( arg.substr(10) );
418     } else if ( arg.find( "--roll=" ) != string::npos ) {
419         roll = atof( arg.substr(7) );
420     } else if ( arg.find( "--pitch=" ) != string::npos ) {
421         pitch = atof( arg.substr(8) );
422     } else if ( arg.find( "--fg-root=" ) != string::npos ) {
423         fg_root = arg.substr( 10 );
424     } else if ( arg.find( "--flight-model=" ) != string::npos ) {
425         flight_model = parse_flight_model( arg.substr(15) );
426     } else if ( arg == "--fog-disable" ) {
427         fog = FG_FOG_DISABLED;  
428     } else if ( arg == "--fog-fastest" ) {
429         fog = FG_FOG_FASTEST;   
430     } else if ( arg == "--fog-nicest" ) {
431         fog = FG_FOG_NICEST;    
432     } else if ( arg.find( "--fov=" ) != string::npos ) {
433         fov = parse_fov( arg.substr(6) );
434     } else if ( arg == "--disable-fullscreen" ) {
435         fullscreen = false;     
436     } else if ( arg== "--enable-fullscreen") {
437         fullscreen = true;      
438     } else if ( arg == "--shading-flat") {
439         shading = 0;    
440     } else if ( arg == "--shading-smooth") {
441         shading = 1;    
442     } else if ( arg == "--disable-skyblend") {
443         skyblend = false;       
444     } else if ( arg== "--enable-skyblend" ) {
445         skyblend = true;        
446     } else if ( arg == "--disable-textures" ) {
447         textures = false;       
448     } else if ( arg == "--enable-textures" ) {
449         textures = true;
450     } else if ( arg == "--disable-wireframe" ) {
451         wireframe = false;      
452     } else if ( arg == "--enable-wireframe" ) {
453         wireframe = true;
454     } else if ( arg.find( "--geometry=" ) != string::npos ) {
455         string geometry = arg.substr( 11 );
456         if ( geometry == "640x480" ) {
457             xsize = 640;
458             ysize = 480;
459         } else if ( geometry == "800x600" ) {
460             xsize = 800;
461             ysize = 600;
462         } else if ( geometry == "1024x768" ) {
463             xsize = 1024;
464             ysize = 768;
465         } else {
466             FG_LOG( FG_GENERAL, FG_ALERT, "Unknown geometry: " << geometry );
467             exit(-1);
468         }
469     } else if ( arg == "--units-feet" ) {
470         units = FG_UNITS_FEET;  
471     } else if ( arg == "--units-meters" ) {
472         units = FG_UNITS_METERS;        
473     } else if ( arg.find( "--tile-radius=" ) != string::npos ) {
474         tile_radius = parse_tile_radius( arg.substr(14) );
475         tile_diameter = tile_radius * 2 + 1;
476     } else if ( arg.find( "--time-offset=" ) != string::npos ) {
477         time_offset = parse_time_offset( (arg.substr(14)) );
478     } else if ( arg == "--hud-tris" ) {
479         tris_or_culled = 0;     
480     } else if ( arg == "--hud-culled" ) {
481         tris_or_culled = 1;
482     } else if ( arg.find( "--serial=" ) != string::npos ) {
483         parse_serial( arg.substr(9) );
484     } else {
485         FG_LOG( FG_GENERAL, FG_ALERT, "Unknown option '" << arg << "'" );
486         return FG_OPTIONS_ERROR;
487     }
488     
489     return FG_OPTIONS_OK;
490 }
491
492
493 // Parse the command line options
494 int fgOPTIONS::parse_command_line( int argc, char **argv ) {
495     int i = 1;
496     int result;
497
498     FG_LOG(FG_GENERAL, FG_INFO, "Processing command line arguments");
499
500     while ( i < argc ) {
501         FG_LOG( FG_GENERAL, FG_DEBUG, "argv[" << i << "] = " << argv[i] );
502
503         result = parse_option(argv[i]);
504         if ( (result == FG_OPTIONS_HELP) || (result == FG_OPTIONS_ERROR) ) {
505             return(result);
506         }
507
508         i++;
509     }
510     
511     return(FG_OPTIONS_OK);
512 }
513
514
515 // Parse config file options
516 int fgOPTIONS::parse_config_file( const string& path ) {
517     fg_gzifstream in( path );
518     if ( !in )
519         return(FG_OPTIONS_ERROR);
520
521     FG_LOG( FG_GENERAL, FG_INFO, "Processing config file: " << path );
522
523     in >> skipcomment;
524     while ( !in.eof() )
525     {
526         string line;
527         getline( in, line );
528
529         if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
530             FG_LOG( FG_GENERAL, FG_ALERT, 
531                     "Config file parse error: " << path << " '" 
532                     << line << "'" );
533             exit(-1);
534         }
535         in >> skipcomment;
536     }
537
538     return FG_OPTIONS_OK;
539 }
540
541
542 // Print usage message
543 void fgOPTIONS::usage ( void ) {
544     printf("Usage: fg [ options ... ]\n");
545     printf("\n");
546
547     printf("General Options:\n");
548     printf("\t--help -h:  print usage\n");
549     printf("\t--fg-root=path:  specify the root path for all the data files\n");
550     printf("\t--disable-game-mode:  disable full-screen game mode\n");
551     printf("\t--enable-game-mode:  enable full-screen game mode\n");
552     printf("\t--disable-splash-screen:  disable splash screen\n");
553     printf("\t--enable-splash-screen:  enable splash screen\n");
554     printf("\t--disable-intro-music:  disable introduction music\n");
555     printf("\t--enable-intro-music:  enable introduction music\n");
556     printf("\t--disable-mouse-pointer:  disable extra mouse pointer\n");
557     printf("\t--enable-mouse-pointer:  enable extra mouse pointer (i.e. for\n");
558     printf("\t\tfull screen voodoo/voodoo-II based cards.)\n");
559     printf("\t--disable-pause:  start out in an active state\n");
560     printf("\t--enable-pause:  start out in a paused state\n");
561     printf("\n");
562
563     printf("Features:\n");
564     printf("\t--disable-hud:  disable heads up display\n");
565     printf("\t--enable-hud:  enable heads up display\n");
566     printf("\t--disable-panel:  disable instrument panel\n");
567     printf("\t--enable-panel:  enable instrumetn panel\n");
568     printf("\t--disable-sound:  disable sound effects\n");
569     printf("\t--enable-sound:  enable sound effects\n");
570     printf("\n");
571  
572     printf("Initial Position and Orientation:\n");
573     printf("\t--airport-id=ABCD:  specify starting postion by airport id\n");
574     printf("\t--lon=degrees:  starting longitude in degrees (west = -)\n");
575     printf("\t--lat=degrees:  starting latitude in degrees (south = -)\n");
576     printf("\t--altitude=meters:  starting altitude in meters\n");
577     printf("\t--heading=degrees:  heading (yaw) angle in degress (Psi)\n");
578     printf("\t--roll=degrees:  roll angle in degrees (Phi)\n");
579     printf("\t--pitch=degrees:  pitch angle in degrees (Theta)\n");
580     printf("\n");
581
582     printf("Rendering Options:\n");
583     printf("\t--fog-disable:  disable fog/haze\n");
584     printf("\t--fog-fastest:  enable fastest fog/haze\n");
585     printf("\t--fog-nicest:  enable nicest fog/haze\n");
586     printf("\t--fov=xx.x:  specify initial field of view angle in degrees\n");
587     printf("\t--disable-fullscreen:  disable fullscreen mode\n");
588     printf("\t--enable-fullscreen:  enable fullscreen mode\n");
589     printf("\t--shading-flat:  enable flat shading\n");
590     printf("\t--shading-smooth:  enable smooth shading\n");
591     printf("\t--disable-skyblend:  disable sky blending\n");
592     printf("\t--enable-skyblend:  enable sky blending\n");
593     printf("\t--disable-textures:  disable textures\n");
594     printf("\t--enable-textures:  enable textures\n");
595     printf("\t--disable-wireframe:  disable wireframe drawing mode\n");
596     printf("\t--enable-wireframe:  enable wireframe drawing mode\n");
597     printf("\t--geometry=WWWxHHH:  window geometry: 640x480, 800x600, etc.\n");
598     printf("\n");
599
600     printf("Scenery Options:\n");
601     printf("\t--tile-radius=n:  specify tile radius, must be 1 - 4\n");
602     printf("\n");
603
604     printf("Hud Options:\n");
605     printf("\t--units-feet:  Hud displays units in feet\n");
606     printf("\t--units-meters:  Hud displays units in meters\n");
607     printf("\t--hud-tris:  Hud displays number of triangles rendered\n");
608     printf("\t--hud-culled:  Hud displays percentage of triangles culled\n");
609         
610     printf("Time Options:\n");
611     printf("\t--time-offset=[+-]hh:mm:ss:  offset local time by this amount\n");
612 }
613
614
615 // Destructor
616 fgOPTIONS::~fgOPTIONS( void ) {
617 }
618
619
620 // $Log$
621 // Revision 1.32  1998/11/25 01:34:00  curt
622 // Support for an arbitrary number of serial ports.
623 //
624 // Revision 1.31  1998/11/23 21:49:04  curt
625 // Borland portability tweaks.
626 //
627 // Revision 1.30  1998/11/16 14:00:02  curt
628 // Added pow() macro bug work around.
629 // Added support for starting FGFS at various resolutions.
630 // Added some initial serial port support.
631 // Specify default log levels in main().
632 //
633 // Revision 1.29  1998/11/06 21:18:12  curt
634 // Converted to new logstream debugging facility.  This allows release
635 // builds with no messages at all (and no performance impact) by using
636 // the -DFG_NDEBUG flag.
637 //
638 // Revision 1.28  1998/11/06 14:47:03  curt
639 // Changes to track Bernie's updates to fgstream.
640 //
641 // Revision 1.27  1998/11/02 23:04:04  curt
642 // HUD units now display in feet by default with meters being a command line
643 // option.
644 //
645 // Revision 1.26  1998/10/17 01:34:24  curt
646 // C++ ifying ...
647 //
648 // Revision 1.25  1998/09/15 02:09:27  curt
649 // Include/fg_callback.hxx
650 //   Moved code inline to stop g++ 2.7 from complaining.
651 //
652 // Simulator/Time/event.[ch]xx
653 //   Changed return type of fgEVENT::printStat().  void caused g++ 2.7 to
654 //   complain bitterly.
655 //
656 // Minor bugfix and changes.
657 //
658 // Simulator/Main/GLUTmain.cxx
659 //   Added missing type to idle_state definition - eliminates a warning.
660 //
661 // Simulator/Main/fg_init.cxx
662 //   Changes to airport lookup.
663 //
664 // Simulator/Main/options.cxx
665 //   Uses fg_gzifstream when loading config file.
666 //
667 // Revision 1.24  1998/09/08 15:04:33  curt
668 // Optimizations by Norman Vine.
669 //
670 // Revision 1.23  1998/08/27 17:02:07  curt
671 // Contributions from Bernie Bright <bbright@c031.aone.net.au>
672 // - use strings for fg_root and airport_id and added methods to return
673 //   them as strings,
674 // - inlined all access methods,
675 // - made the parsing functions private methods,
676 // - deleted some unused functions.
677 // - propogated some of these changes out a bit further.
678 //
679 // Revision 1.22  1998/08/24 20:11:13  curt
680 // Added i/I to toggle full vs. minimal HUD.
681 // Added a --hud-tris vs --hud-culled option.
682 // Moved options accessor funtions to options.hxx.
683 //
684 // Revision 1.21  1998/08/20 15:10:34  curt
685 // Added GameGLUT support.
686 //
687 // Revision 1.20  1998/07/30 23:48:28  curt
688 // Output position & orientation when pausing.
689 // Eliminated libtool use.
690 // Added options to specify initial position and orientation.
691 // Changed default fov to 55 degrees.
692 // Added command line option to start in paused or unpaused state.
693 //
694 // Revision 1.19  1998/07/27 18:41:25  curt
695 // Added a pause command "p"
696 // Fixed some initialization order problems between pui and glut.
697 // Added an --enable/disable-sound option.
698 //
699 // Revision 1.18  1998/07/22 01:27:03  curt
700 // Strip out \r when parsing config file in case we are on a windoze system.
701 //
702 // Revision 1.17  1998/07/16 17:33:38  curt
703 // "H" / "h" now control hud brightness as well with off being one of the
704 //   states.
705 // Better checking for xmesa/fx 3dfx fullscreen/window support for deciding
706 //   whether or not to build in the feature.
707 // Translucent menu support.
708 // HAVE_AUDIO_SUPPORT -> ENABLE_AUDIO_SUPPORT
709 // Use fork() / wait() for playing mp3 init music in background under unix.
710 // Changed default tile diameter to 5.
711 //
712 // Revision 1.16  1998/07/13 21:01:39  curt
713 // Wrote access functions for current fgOPTIONS.
714 //
715 // Revision 1.15  1998/07/06 21:34:19  curt
716 // Added an enable/disable splash screen option.
717 // Added an enable/disable intro music option.
718 // Added an enable/disable instrument panel option.
719 // Added an enable/disable mouse pointer option.
720 // Added using namespace std for compilers that support this.
721 //
722 // Revision 1.14  1998/07/04 00:52:26  curt
723 // Add my own version of gluLookAt() (which is nearly identical to the
724 // Mesa/glu version.)  But, by calculating the Model View matrix our selves
725 // we can save this matrix without having to read it back in from the video
726 // card.  This hopefully allows us to save a few cpu cycles when rendering
727 // out the fragments because we can just use glLoadMatrixd() with the
728 // precalculated matrix for each tile rather than doing a push(), translate(),
729 // pop() for every fragment.
730 //
731 // Panel status defaults to off for now until it gets a bit more developed.
732 //
733 // Extract OpenGL driver info on initialization.
734 //
735 // Revision 1.13  1998/06/27 16:54:34  curt
736 // Replaced "extern displayInstruments" with a entry in fgOPTIONS.
737 // Don't change the view port when displaying the panel.
738 //
739 // Revision 1.12  1998/06/17 21:35:13  curt
740 // Refined conditional audio support compilation.
741 // Moved texture parameter setup calls to ../Scenery/materials.cxx
742 // #include <string.h> before various STL includes.
743 // Make HUD default state be enabled.
744 //
745 // Revision 1.11  1998/06/13 00:40:33  curt
746 // Tweaked fog command line options.
747 //
748 // Revision 1.10  1998/05/16 13:08:36  curt
749 // C++ - ified views.[ch]xx
750 // Shuffled some additional view parameters into the fgVIEW class.
751 // Changed tile-radius to tile-diameter because it is a much better
752 //   name.
753 // Added a WORLD_TO_EYE transformation to views.cxx.  This allows us
754 //  to transform world space to eye space for view frustum culling.
755 //
756 // Revision 1.9  1998/05/13 18:29:59  curt
757 // Added a keyboard binding to dynamically adjust field of view.
758 // Added a command line option to specify fov.
759 // Adjusted terrain color.
760 // Root path info moved to fgOPTIONS.
761 // Added ability to parse options out of a config file.
762 //
763 // Revision 1.8  1998/05/07 23:14:16  curt
764 // Added "D" key binding to set autopilot heading.
765 // Made frame rate calculation average out over last 10 frames.
766 // Borland C++ floating point exception workaround.
767 // Added a --tile-radius=n option.
768 //
769 // Revision 1.7  1998/05/06 03:16:25  curt
770 // Added an averaged global frame rate counter.
771 // Added an option to control tile radius.
772 //
773 // Revision 1.6  1998/05/03 00:47:32  curt
774 // Added an option to enable/disable full-screen mode.
775 //
776 // Revision 1.5  1998/04/30 12:34:19  curt
777 // Added command line rendering options:
778 //   enable/disable fog/haze
779 //   specify smooth/flat shading
780 //   disable sky blending and just use a solid color
781 //   enable wireframe drawing mode
782 //
783 // Revision 1.4  1998/04/28 01:20:22  curt
784 // Type-ified fgTIME and fgVIEW.
785 // Added a command line option to disable textures.
786 //
787 // Revision 1.3  1998/04/26 05:01:19  curt
788 // Added an rint() / HAVE_RINT check.
789 //
790 // Revision 1.2  1998/04/25 15:11:12  curt
791 // Added an command line option to set starting position based on airport ID.
792 //
793 // Revision 1.1  1998/04/24 00:49:21  curt
794 // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
795 // Trying out some different option parsing code.
796 // Some code reorganization.
797 //
798 //