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