]> git.mxchange.org Git - flightgear.git/blob - Main/fg_init.cxx
Added a pause command "p"
[flightgear.git] / Main / fg_init.cxx
1 //
2 // fg_init.cxx -- Flight Gear top level initialization routines
3 //
4 // Written by Curtis Olson, started August 1997.
5 //
6 // Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
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 //
23 // $Id$
24 // (Log is kept at end of this file)
25
26
27 #ifdef HAVE_CONFIG_H
28 #  include <config.h>
29 #endif
30
31 #include <stdio.h>
32 #include <stdlib.h>
33
34 // work around a stdc++ lib bug in some versions of linux, but doesn't
35 // seem to hurt to have this here for all versions of Linux.
36 #ifdef linux
37 #  define _G_NO_EXTERN_TEMPLATES
38 #endif
39
40 #include <string.h>
41
42 #include <Include/fg_constants.h>
43 #include <Include/general.h>
44
45 #include <Aircraft/aircraft.h>
46 #include <Astro/moon.hxx>
47 #include <Astro/planets.hxx>
48 #include <Astro/sky.hxx>
49 #include <Astro/stars.hxx>
50 #include <Astro/sun.hxx>
51 #include <Autopilot/autopilot.h>
52 #include <Cockpit/cockpit.hxx>
53 #include <Debug/fg_debug.h>
54 #include <Joystick/joystick.h>
55 #include <Math/fg_random.h>
56 #include <Scenery/scenery.hxx>
57 #include <Scenery/tilemgr.hxx>
58 #include <Time/event.hxx>
59 #include <Time/fg_time.hxx>
60 #include <Time/light.hxx>
61 #include <Time/sunpos.hxx>
62 #include <Weather/weather.h>
63
64 #include "airports.hxx"
65 #include "fg_init.hxx"
66 #include "options.hxx"
67 #include "views.hxx"
68
69
70 extern const char *default_root;
71
72
73 // Set initial position
74 int fgInitPosition( void ) {
75     char id[5];
76     fgFLIGHT *f;
77
78     f = current_aircraft.flight;
79
80     // If nothing else is specified, default initial position is
81     // Globe, AZ (P13)
82     FG_Longitude = ( -110.6642444 ) * DEG_TO_RAD;
83     FG_Latitude  = (  33.3528917 ) * DEG_TO_RAD;
84     FG_Runway_altitude = (3234.5);
85     FG_Altitude = -1000 /* FG_Runway_altitude + 3.758099 */;
86
87     // Initial Position north of the city of Globe
88     // FG_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD;
89     // FG_Latitude  = (  120625.64 / 3600.0 ) * DEG_TO_RAD;
90     // FG_Longitude = ( -397867.44 / 3600.0 ) * DEG_TO_RAD;
91     // FG_Latitude  = (  119548.21 / 3600.0 ) * DEG_TO_RAD;
92     // FG_Altitude = 0.0 + 3.758099;
93
94     // Initial Position near where I used to live in Globe, AZ
95     // FG_Longitude = ( -398757.6 / 3600.0 ) * DEG_TO_RAD;
96     // FG_Latitude  = (  120160.0 / 3600.0 ) * DEG_TO_RAD;
97     // FG_Runway_altitude = 4000.0;
98     // FG_Altitude = FG_Runway_altitude + 3.758099;
99
100     // Initial Position: 10125 Jewell St. NE
101     // FG_Longitude = ( -93.15 ) * DEG_TO_RAD;
102     // FG_Latitude  = (  45.15 ) * DEG_TO_RAD;
103     // FG_Runway_altitude = 950.0;
104     // FG_Altitude = FG_Runway_altitude + 3.758099;
105
106     // Initial Position near KHSP (Hot Springs, VA)
107     // FG_Longitude = (-79.8338964 + 0.01) * DEG_TO_RAD;
108     // FG_Latitude  = ( 37.9514564 + 0.008) * DEG_TO_RAD;
109     // FG_Runway_altitude = (3792 + 2800);
110     // FG_Altitude = FG_Runway_altitude + 3.758099;
111
112     // Initial Position at (SEZ) SEDONA airport
113     // FG_Longitude = (-111.7884614 + 0.01) * DEG_TO_RAD;
114     // FG_Latitude  = (  34.8486289 - 0.015) * DEG_TO_RAD;
115     // FG_Runway_altitude = (4827 + 450);
116     // FG_Altitude = FG_Runway_altitude + 3.758099;
117
118     // Initial Position: Somewhere near the Grand Canyon
119     // FG_Longitude = ( -112.5 ) * DEG_TO_RAD;
120     // FG_Latitude  = (  36.5 ) * DEG_TO_RAD;
121     // FG_Runway_altitude = 8000.0;
122     // FG_Altitude = FG_Runway_altitude + 3.758099;
123
124     // Initial Position: Jim Brennon's Kingmont Observatory
125     // FG_Longitude = ( -121.1131667 ) * DEG_TO_RAD;
126     // FG_Latitude  = (   38.8293917 ) * DEG_TO_RAD;
127     // FG_Runway_altitude = 920.0;
128     // FG_Altitude = FG_Runway_altitude + 3.758099;
129
130     // Initial Position: Huaras, Peru (S09d 31.871'  W077d 31.498')
131     // FG_Longitude = ( -77.5249667 ) * DEG_TO_RAD;
132     // FG_Latitude  = (  -9.5311833 ) * DEG_TO_RAD;
133     // FG_Runway_altitude = 0.0;
134     // FG_Altitude = FG_Runway_altitude + 3.758099;
135  
136     // Eclipse Watching w73.5 n10 (approx) 18:00 UT
137     // FG_Longitude = ( -73.5 ) * DEG_TO_RAD;
138     // FG_Latitude  = (  10.0 ) * DEG_TO_RAD;
139     // FG_Runway_altitude = 0.0;
140     // FG_Altitude = FG_Runway_altitude + 3.758099;
141
142     // Test Position
143     // FG_Longitude = (  8.5 ) * DEG_TO_RAD;
144     // FG_Latitude  = ( 47.5 ) * DEG_TO_RAD;
145     // FG_Runway_altitude = ( 6000 );
146     // FG_Altitude = FG_Runway_altitude + 3.758099;
147
148     current_options.get_airport_id(id);
149     if ( strlen(id) ) {
150         fgAIRPORTS airports;
151         fgAIRPORT a;
152
153         fgPrintf( FG_GENERAL, FG_INFO, 
154                   "Attempting to set starting position from airport code %s.\n",
155                   id);
156
157         airports.load("Airports");
158         a = airports.search(id);
159         if ( (fabs(a.longitude) < FG_EPSILON) &&
160              (fabs(a.latitude) < FG_EPSILON) &&
161              (fabs(a.elevation) < FG_EPSILON) ) {
162             fgPrintf( FG_GENERAL, FG_EXIT, 
163                       "Failed to find %s in database.\n", id);
164         } else {
165             FG_Longitude = ( a.longitude ) * DEG_TO_RAD;
166             FG_Latitude  = ( a.latitude ) * DEG_TO_RAD;
167             FG_Runway_altitude = ( -1000 /* a.elevation */ );
168             FG_Altitude = FG_Runway_altitude + 3.758099;
169         }
170     }
171     
172     fgPrintf( FG_GENERAL, FG_INFO, 
173               "Initial position is: (%.4f, %.4f, %.2f)\n", 
174               FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, 
175               FG_Altitude * FEET_TO_METER);
176
177     return(1);
178 }
179
180
181 // General house keeping initializations
182 int fgInitGeneral( void ) {
183     fgGENERAL *g;
184     char root[256];
185     int i;
186
187     g = &general;
188
189     fgPrintf( FG_GENERAL, FG_INFO, "General Initialization\n" );
190     fgPrintf( FG_GENERAL, FG_INFO, "======= ==============\n" );
191
192     g->glVendor = (char *)glGetString ( GL_VENDOR );
193     g->glRenderer = (char *)glGetString ( GL_RENDERER );
194     g->glVersion = (char *)glGetString ( GL_VERSION );
195
196     current_options.get_fg_root(root);
197     if ( !strlen(root) ) { 
198         // No root path set? Then bail ...
199         fgPrintf( FG_GENERAL, FG_EXIT, "%s %s\n",
200                   "Cannot continue without environment variable FG_ROOT",
201                   "being defined.");
202     }
203     fgPrintf( FG_GENERAL, FG_INFO, "FG_ROOT = %s\n\n", root);
204
205     // prime the frame rate counter pump
206     for ( i = 0; i < FG_FRAME_RATE_HISTORY; i++ ) {
207         g->frames[i] = 0.0;
208     }
209
210     return ( 1 ); 
211 }
212
213
214 // This is the top level init routine which calls all the other
215 // initialization routines.  If you are adding a subsystem to flight
216 // gear, its initialization call should located in this routine.
217 // Returns non-zero if a problem encountered.
218 int fgInitSubsystems( void ) {
219     fgFLIGHT *f;
220     fgLIGHT *l;
221     fgTIME *t;
222     fgVIEW *v;
223
224     l = &cur_light_params;
225     t = &cur_time_params;
226     v = &current_view;
227
228     fgPrintf( FG_GENERAL, FG_INFO, "Initialize Subsystems\n");
229     fgPrintf( FG_GENERAL, FG_INFO, "========== ==========\n");
230
231     // seed the random number generater
232     fg_srandom();
233
234     // The following section sets up the flight model EOM parameters
235     // and should really be read in from one or more files.
236
237     // Must happen before any of the flight model or control
238     // parameters are set
239
240     fgAircraftInit();   // In the future this might not be the case.
241     f = current_aircraft.flight;
242
243     // set the initial position
244     fgInitPosition();
245
246     // Initial Velocity
247     FG_V_north = 0.0;   //  7.287719E+00
248     FG_V_east  = 0.0;   //  1.521770E+03
249     FG_V_down  = 0.0;   // -1.265722E-05
250
251     // Initial Orientation
252     FG_Phi   = -2.658474E-06;
253     FG_Theta =  7.401790E-03;
254     FG_Psi   =  270.0 * DEG_TO_RAD;
255
256     // Initial Angular B rates
257     FG_P_body = 7.206685E-05;
258     FG_Q_body = 0.000000E+00;
259     FG_R_body = 9.492658E-05;
260
261     FG_Earth_position_angle = 0.000000E+00;
262
263     // Mass properties and geometry values
264     FG_Mass = 8.547270E+01;
265     FG_I_xx = 1.048000E+03;
266     FG_I_yy = 3.000000E+03;
267     FG_I_zz = 3.530000E+03;
268     FG_I_xz = 0.000000E+00;
269
270     // CG position w.r.t. ref. point
271     FG_Dx_cg = 0.000000E+00;
272     FG_Dy_cg = 0.000000E+00;
273     FG_Dz_cg = 0.000000E+00;
274
275     // Initialize the event manager
276     global_events.Init();
277
278     // Output event stats every 60 seconds
279     global_events.Register( "fgEventPrintStats()", fgEventPrintStats,
280                             FG_EVENT_READY, 60000 );
281
282     // Initialize the time dependent variables
283     fgTimeInit(t);
284     fgTimeUpdate(f, t);
285
286     // Initialize view parameters
287     v->Init();
288     v->Update(f);
289     v->UpdateWorldToEye(f);
290
291     // Initialize the orbital elements of sun, moon and mayor planets
292     fgSolarSystemInit(*t);
293
294     // Initialize the Stars subsystem
295     if( fgStarsInit() ) {
296         // Stars initialized ok.
297     } else {
298         fgPrintf( FG_GENERAL, FG_EXIT, "Error in Stars initialization!\n" );
299     }
300
301     // Initialize the planetary subsystem
302     global_events.Register( "fgPlanetsInit()", fgPlanetsInit, 
303                             FG_EVENT_READY, 600000);
304
305     // Initialize the sun's position 
306     global_events.Register( "fgSunInit()", fgSunInit, 
307                             FG_EVENT_READY, 30000 );
308
309     // Intialize the moon's position
310     global_events.Register( "fgMoonInit()", fgMoonInit, 
311                             FG_EVENT_READY, 600000 );
312
313     // fgUpdateSunPos() needs a few position and view parameters set
314     // so it can calculate local relative sun angle and a few other
315     // things for correctly orienting the sky.
316     fgUpdateSunPos();
317
318     // Initialize Lighting interpolation tables
319     l->Init();
320
321     // update the lighting parameters (based on sun angle)
322     global_events.Register( "fgLightUpdate()", fgLightUpdate,
323                             FG_EVENT_READY, 30000 );
324
325     // Initialize the weather modeling subsystem
326     fgWeatherInit();
327
328     // update the weather for our current position
329     global_events.Register( "fgWeatherUpdate()", fgWeatherUpdate,
330                             FG_EVENT_READY, 120000 );
331
332     // Initialize the Cockpit subsystem
333     if( fgCockpitInit( &current_aircraft )) {
334         // Cockpit initialized ok.
335     } else {
336         fgPrintf( FG_GENERAL, FG_EXIT, "Error in Cockpit initialization!\n" );
337     }
338
339     // Initialize the "sky"
340     fgSkyInit();
341
342     // Initialize the Scenery Management subsystem
343     if ( fgSceneryInit() ) {
344         // Scenery initialized ok.
345     } else {
346         fgPrintf( FG_GENERAL, FG_EXIT, "Error in Scenery initialization!\n" );
347     }
348
349     if( fgTileMgrInit() ) {
350         // Load the local scenery data
351         fgTileMgrUpdate();
352     } else {
353         fgPrintf( FG_GENERAL, FG_EXIT, 
354                   "Error in Tile Manager initialization!\n" );
355     }
356
357     // I'm just sticking this here for now, it should probably move
358     // eventually
359     scenery.cur_elev = FG_Runway_altitude * FEET_TO_METER;
360
361     if ( FG_Altitude < FG_Runway_altitude + 3.758099) {
362         FG_Altitude = FG_Runway_altitude + 3.758099;
363     }
364
365     fgPrintf( FG_GENERAL, FG_INFO,
366               "Updated position (after elevation adj): (%.4f, %.4f, %.2f)\n",
367               FG_Latitude * RAD_TO_DEG, FG_Longitude * RAD_TO_DEG,
368               FG_Altitude * FEET_TO_METER);
369     // end of thing that I just stuck in that I should probably move
370                 
371     // Initialize the flight model subsystem data structures base on
372     // above values
373
374     fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ );
375
376     // I'm just sticking this here for now, it should probably move
377     // eventually
378     scenery.cur_elev = FG_Runway_altitude * FEET_TO_METER;
379
380     if ( FG_Altitude < FG_Runway_altitude + 3.758099) {
381         FG_Altitude = FG_Runway_altitude + 3.758099;
382     }
383
384     fgPrintf( FG_GENERAL, FG_INFO,
385               "Updated position (after elevation adj): (%.4f, %.4f, %.2f)\n",
386               FG_Latitude * RAD_TO_DEG, FG_Longitude * RAD_TO_DEG,
387               FG_Altitude * FEET_TO_METER);
388     // end of thing that I just stuck in that I should probably move
389
390     // Joystick support
391     if (fgJoystickInit(0) ) {
392         // Joystick initialized ok.
393     } else {
394         fgPrintf( FG_GENERAL, FG_EXIT, "Error in Joystick initialization!\n" );
395     }
396
397     // Autopilot init added here, by Jeff Goeke-Smith
398     fgAPInit(&current_aircraft);
399     
400     fgPrintf(FG_GENERAL, FG_INFO,"\n");
401
402     return(1);
403 }
404
405
406 // $Log$
407 // Revision 1.28  1998/07/27 18:41:25  curt
408 // Added a pause command "p"
409 // Fixed some initialization order problems between pui and glut.
410 // Added an --enable/disable-sound option.
411 //
412 // Revision 1.27  1998/07/24 21:39:10  curt
413 // Debugging output tweaks.
414 // Cast glGetString to (char *) to avoid compiler errors.
415 // Optimizations to fgGluLookAt() by Norman Vine.
416 //
417 // Revision 1.26  1998/07/22 21:40:44  curt
418 // Clear to adjusted fog color (for sunrise/sunset effects)
419 // Make call to fog sunrise/sunset adjustment method.
420 // Add a stdc++ library bug work around to fg_init.cxx
421 //
422 // Revision 1.25  1998/07/13 21:01:38  curt
423 // Wrote access functions for current fgOPTIONS.
424 //
425 // Revision 1.24  1998/07/13 15:32:39  curt
426 // Clear color buffer if drawing wireframe.
427 // When specifying and airport, start elevation at -1000 and let the system
428 // position you at ground level.
429 //
430 // Revision 1.23  1998/07/12 03:14:43  curt
431 // Added ground collision detection.
432 // Did some serious horsing around to be able to "hug" the ground properly
433 //   and still be able to take off.
434 // Set the near clip plane to 1.0 meters when less than 10 meters above the
435 //   ground.
436 // Did some serious horsing around getting the initial airplane position to be
437 //   correct based on rendered terrain elevation.
438 // Added a little cheat/hack that will prevent the view position from ever
439 //   dropping below the terrain, even when the flight model doesn't quite
440 //   put you as high as you'd like.
441 //
442 // Revision 1.22  1998/07/04 00:52:25  curt
443 // Add my own version of gluLookAt() (which is nearly identical to the
444 // Mesa/glu version.)  But, by calculating the Model View matrix our selves
445 // we can save this matrix without having to read it back in from the video
446 // card.  This hopefully allows us to save a few cpu cycles when rendering
447 // out the fragments because we can just use glLoadMatrixd() with the
448 // precalculated matrix for each tile rather than doing a push(), translate(),
449 // pop() for every fragment.
450 //
451 // Panel status defaults to off for now until it gets a bit more developed.
452 //
453 // Extract OpenGL driver info on initialization.
454 //
455 // Revision 1.21  1998/06/27 16:54:33  curt
456 // Replaced "extern displayInstruments" with a entry in fgOPTIONS.
457 // Don't change the view port when displaying the panel.
458 //
459 // Revision 1.20  1998/06/17 21:35:12  curt
460 // Refined conditional audio support compilation.
461 // Moved texture parameter setup calls to ../Scenery/materials.cxx
462 // #include <string.h> before various STL includes.
463 // Make HUD default state be enabled.
464 //
465 // Revision 1.19  1998/06/08 17:57:05  curt
466 // Minor sound/startup position tweaks.
467 //
468 // Revision 1.18  1998/06/03 00:47:14  curt
469 // Updated to compile in audio support if OSS available.
470 // Updated for new version of Steve's audio library.
471 // STL includes don't use .h
472 // Small view optimizations.
473 //
474 // Revision 1.17  1998/06/01 17:54:42  curt
475 // Added Linux audio support.
476 // avoid glClear( COLOR_BUFFER_BIT ) when not using it to set the sky color.
477 // map stl tweaks.
478 //
479 // Revision 1.16  1998/05/29 20:37:24  curt
480 // Tweaked material properties & lighting a bit in GLUTmain.cxx.
481 // Read airport list into a "map" STL for dynamic list sizing and fast tree
482 // based lookups.
483 //
484 // Revision 1.15  1998/05/22 21:28:53  curt
485 // Modifications to use the new fgEVENT_MGR class.
486 //
487 // Revision 1.14  1998/05/20 20:51:35  curt
488 // Tweaked smooth shaded texture lighting properties.
489 // Converted fgLIGHT to a C++ class.
490 //
491 // Revision 1.13  1998/05/16 13:08:35  curt
492 // C++ - ified views.[ch]xx
493 // Shuffled some additional view parameters into the fgVIEW class.
494 // Changed tile-radius to tile-diameter because it is a much better
495 //   name.
496 // Added a WORLD_TO_EYE transformation to views.cxx.  This allows us
497 //  to transform world space to eye space for view frustum culling.
498 //
499 // Revision 1.12  1998/05/13 18:29:58  curt
500 // Added a keyboard binding to dynamically adjust field of view.
501 // Added a command line option to specify fov.
502 // Adjusted terrain color.
503 // Root path info moved to fgOPTIONS.
504 // Added ability to parse options out of a config file.
505 //
506 // Revision 1.11  1998/05/07 23:14:15  curt
507 // Added "D" key binding to set autopilot heading.
508 // Made frame rate calculation average out over last 10 frames.
509 // Borland C++ floating point exception workaround.
510 // Added a --tile-radius=n option.
511 //
512 // Revision 1.10  1998/05/06 03:16:24  curt
513 // Added an averaged global frame rate counter.
514 // Added an option to control tile radius.
515 //
516 // Revision 1.9  1998/05/03 00:47:31  curt
517 // Added an option to enable/disable full-screen mode.
518 //
519 // Revision 1.8  1998/04/30 12:34:18  curt
520 // Added command line rendering options:
521 //   enable/disable fog/haze
522 //   specify smooth/flat shading
523 //   disable sky blending and just use a solid color
524 //   enable wireframe drawing mode
525 //
526 // Revision 1.7  1998/04/28 01:20:22  curt
527 // Type-ified fgTIME and fgVIEW.
528 // Added a command line option to disable textures.
529 //
530 // Revision 1.6  1998/04/26 05:10:03  curt
531 // "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
532 //
533 // Revision 1.5  1998/04/25 22:06:30  curt
534 // Edited cvs log messages in source files ... bad bad bad!
535 //
536 // Revision 1.4  1998/04/25 20:24:01  curt
537 // Cleaned up initialization sequence to eliminate interdependencies
538 // between sun position, lighting, and view position.  This creates a
539 // valid single pass initialization path.
540 //
541 // Revision 1.3  1998/04/25 15:11:11  curt
542 // Added an command line option to set starting position based on airport ID.
543 //
544 // Revision 1.2  1998/04/24 00:49:20  curt
545 // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
546 // Trying out some different option parsing code.
547 // Some code reorganization.
548 //
549 // Revision 1.1  1998/04/22 13:25:44  curt
550 // C++ - ifing the code.
551 // Starting a bit of reorganization of lighting code.
552 //
553 // Revision 1.56  1998/04/18 04:11:28  curt
554 // Moved fg_debug to it's own library, added zlib support.
555 //
556 // Revision 1.55  1998/04/14 02:21:03  curt
557 // Incorporated autopilot heading hold contributed by:  Jeff Goeke-Smith
558 // <jgoeke@voyager.net>
559 //
560 // Revision 1.54  1998/04/08 23:35:36  curt
561 // Tweaks to Gnu automake/autoconf system.
562 //
563 // Revision 1.53  1998/04/03 22:09:06  curt
564 // Converting to Gnu autoconf system.
565 //
566 // Revision 1.52  1998/03/23 21:24:38  curt
567 // Source code formating tweaks.
568 //
569 // Revision 1.51  1998/03/14 00:31:22  curt
570 // Beginning initial terrain texturing experiments.
571 //
572 // Revision 1.50  1998/03/09 22:46:19  curt
573 // Minor tweaks.
574 //
575 // Revision 1.49  1998/02/23 19:07:59  curt
576 // Incorporated Durk's Astro/ tweaks.  Includes unifying the sun position
577 // calculation code between sun display, and other FG sections that use this
578 // for things like lighting.
579 //
580 // Revision 1.48  1998/02/21 14:53:15  curt
581 // Added Charlie's HUD changes.
582 //
583 // Revision 1.47  1998/02/19 13:05:53  curt
584 // Incorporated some HUD tweaks from Michelle America.
585 // Tweaked the sky's sunset/rise colors.
586 // Other misc. tweaks.
587 //
588 // Revision 1.46  1998/02/18 15:07:06  curt
589 // Tweaks to build with SGI OpenGL (and therefor hopefully other accelerated
590 // drivers will work.)
591 //
592 // Revision 1.45  1998/02/16 13:39:43  curt
593 // Miscellaneous weekend tweaks.  Fixed? a cache problem that caused whole
594 // tiles to occasionally be missing.
595 //
596 // Revision 1.44  1998/02/12 21:59:50  curt
597 // Incorporated code changes contributed by Charlie Hotchkiss
598 // <chotchkiss@namg.us.anritsu.com>
599 //
600 // Revision 1.43  1998/02/11 02:50:40  curt
601 // Minor changes.
602 //
603 // Revision 1.42  1998/02/09 22:56:58  curt
604 // Removed "depend" files from cvs control.  Other minor make tweaks.
605 //
606 // Revision 1.41  1998/02/09 15:07:50  curt
607 // Minor tweaks.
608 //
609 // Revision 1.40  1998/02/07 15:29:44  curt
610 // Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
611 // <chotchkiss@namg.us.anritsu.com>
612 //
613 // Revision 1.39  1998/02/03 23:20:25  curt
614 // Lots of little tweaks to fix various consistency problems discovered by
615 // Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
616 // passed arguments along to the real printf().  Also incorporated HUD changes
617 // by Michele America.
618 //
619 // Revision 1.38  1998/02/02 20:53:58  curt
620 // Incorporated Durk's changes.
621 //
622 // Revision 1.37  1998/02/01 03:39:54  curt
623 // Minor tweaks.
624 //
625 // Revision 1.36  1998/01/31 00:43:13  curt
626 // Added MetroWorks patches from Carmen Volpe.
627 //
628 // Revision 1.35  1998/01/27 00:47:57  curt
629 // Incorporated Paul Bleisch's <pbleisch@acm.org> new debug message
630 // system and commandline/config file processing code.
631 //
632 // Revision 1.34  1998/01/22 02:59:37  curt
633 // Changed #ifdef FILE_H to #ifdef _FILE_H
634 //
635 // Revision 1.33  1998/01/21 21:11:34  curt
636 // Misc. tweaks.
637 //
638 // Revision 1.32  1998/01/19 19:27:08  curt
639 // Merged in make system changes from Bob Kuehne <rpk@sgi.com>
640 // This should simplify things tremendously.
641 //
642 // Revision 1.31  1998/01/19 18:40:32  curt
643 // Tons of little changes to clean up the code and to remove fatal errors
644 // when building with the c++ compiler.
645 //
646 // Revision 1.30  1998/01/13 00:23:09  curt
647 // Initial changes to support loading and management of scenery tiles.  Note,
648 // there's still a fair amount of work left to be done.
649 //
650 // Revision 1.29  1998/01/08 02:22:08  curt
651 // Beginning to integrate Tile management subsystem.
652 //
653 // Revision 1.28  1998/01/07 03:18:58  curt
654 // Moved astronomical stuff from .../Src/Scenery to .../Src/Astro/
655 //
656 // Revision 1.27  1998/01/05 18:44:35  curt
657 // Add an option to advance/decrease time from keyboard.
658 //
659 // Revision 1.26  1997/12/30 23:09:04  curt
660 // Tweaking initialization sequences.
661 //
662 // Revision 1.25  1997/12/30 22:22:33  curt
663 // Further integration of event manager.
664 //
665 // Revision 1.24  1997/12/30 20:47:44  curt
666 // Integrated new event manager with subsystem initializations.
667 //
668 // Revision 1.23  1997/12/30 16:36:50  curt
669 // Merged in Durk's changes ...
670 //
671 // Revision 1.22  1997/12/19 23:34:05  curt
672 // Lot's of tweaking with sky rendering and lighting.
673 //
674 // Revision 1.21  1997/12/19 16:45:00  curt
675 // Working on scene rendering order and options.
676 //
677 // Revision 1.20  1997/12/18 23:32:33  curt
678 // First stab at sky dome actually starting to look reasonable. :-)
679 //
680 // Revision 1.19  1997/12/17 23:13:36  curt
681 // Began working on rendering a sky.
682 //
683 // Revision 1.18  1997/12/15 23:54:49  curt
684 // Add xgl wrappers for debugging.
685 // Generate terrain normals on the fly.
686 //
687 // Revision 1.17  1997/12/15 20:59:09  curt
688 // Misc. tweaks.
689 //
690 // Revision 1.16  1997/12/12 19:52:48  curt
691 // Working on lightling and material properties.
692 //
693 // Revision 1.15  1997/12/11 04:43:55  curt
694 // Fixed sun vector and lighting problems.  I thing the moon is now lit
695 // correctly.
696 //
697 // Revision 1.14  1997/12/10 22:37:47  curt
698 // Prepended "fg" on the name of all global structures that didn't have it yet.
699 // i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
700 //
701 // Revision 1.13  1997/11/25 19:25:32  curt
702 // Changes to integrate Durk's moon/sun code updates + clean up.
703 //
704 // Revision 1.12  1997/11/15 18:16:35  curt
705 // minor tweaks.
706 //
707 // Revision 1.11  1997/10/30 12:38:42  curt
708 // Working on new scenery subsystem.
709 //
710 // Revision 1.10  1997/10/25 03:24:23  curt
711 // Incorporated sun, moon, and star positioning code contributed by Durk Talsma.
712 //
713 // Revision 1.9  1997/09/23 00:29:39  curt
714 // Tweaks to get things to compile with gcc-win32.
715 //
716 // Revision 1.8  1997/09/22 14:44:20  curt
717 // Continuing to try to align stars correctly.
718 //
719 // Revision 1.7  1997/09/16 15:50:30  curt
720 // Working on star alignment and time issues.
721 //
722 // Revision 1.6  1997/09/05 14:17:30  curt
723 // More tweaking with stars.
724 //
725 // Revision 1.5  1997/09/04 02:17:36  curt
726 // Shufflin' stuff.
727 //
728 // Revision 1.4  1997/08/27 21:32:26  curt
729 // Restructured view calculation code.  Added stars.
730 //
731 // Revision 1.3  1997/08/27 03:30:19  curt
732 // Changed naming scheme of basic shared structures.
733 //
734 // Revision 1.2  1997/08/25 20:27:23  curt
735 // Merged in initial HUD and Joystick code.
736 //
737 // Revision 1.1  1997/08/23 01:46:20  curt
738 // Initial revision.
739 //
740