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