]> git.mxchange.org Git - flightgear.git/blob - Main/fg_init.cxx
Added an command line option to set starting position based on airport ID.
[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 #include <Include/fg_constants.h>
35 #include <Include/general.h>
36
37 #include <Aircraft/aircraft.h>
38 #include <Astro/moon.hxx>
39 #include <Astro/planets.hxx>
40 #include <Astro/sky.hxx>
41 #include <Astro/stars.hxx>
42 #include <Astro/sun.hxx>
43 #include <Autopilot/autopilot.h>
44 #include <Cockpit/cockpit.hxx>
45 #include <Debug/fg_debug.h>
46 #include <Joystick/joystick.h>
47 #include <Math/fg_random.h>
48 #include <Scenery/scenery.h>
49 #include <Scenery/tilemgr.hxx>
50 #include <Time/event.hxx>
51 #include <Time/fg_time.hxx>
52 #include <Time/light.hxx>
53 #include <Time/sunpos.hxx>
54 #include <Weather/weather.h>
55
56 #include "airports.hxx"
57 #include "fg_init.hxx"
58 #include "options.hxx"
59 #include "views.hxx"
60
61 // extern int show_hud;             // HUD state
62 extern int displayInstruments;
63 extern const char *default_root;
64
65
66 // Set initial position
67 int fgInitPosition( void ) {
68     fgFLIGHT *f;
69     fgOPTIONS *o;
70
71     f = current_aircraft.flight;
72     o = &current_options;
73
74     // Initial Position at (P13) Globe, AZ
75     FG_Longitude = ( -110.6642444 ) * DEG_TO_RAD;
76     FG_Latitude  = (  33.3528917 ) * DEG_TO_RAD;
77     FG_Runway_altitude = (3234.5 + 300);
78     FG_Altitude = FG_Runway_altitude + 3.758099;
79
80     // Initial Position at (E81) Superior, AZ
81     // FG_Longitude = ( -111.1270650 ) * DEG_TO_RAD;
82     // FG_Latitude  = (  33.2778339 ) * DEG_TO_RAD;
83     // FG_Runway_altitude = (2646 + 100);
84     // FG_Altitude = FG_Runway_altitude + 3.758099;
85
86     // Initial Position at (TUS) Tucson, AZ
87     // FG_Longitude = ( -110.9412597 ) * DEG_TO_RAD;
88     // FG_Latitude  = (  32.1162439 ) * DEG_TO_RAD;
89     // FG_Runway_altitude = (2641 + 0);
90     // FG_Altitude = FG_Runway_altitude + 3.758099;
91
92     // Initial Position at (SEZ) SEDONA airport
93     // FG_Longitude = (-111.7884614 + 0.01) * DEG_TO_RAD;
94     // FG_Latitude  = (  34.8486289 - 0.015) * DEG_TO_RAD;
95     // FG_Runway_altitude = (4827 + 450);
96     // FG_Altitude = FG_Runway_altitude + 3.758099;
97         
98     // Initial Position at near Anchoraze, AK
99     // FG_Longitude = ( -152.00 ) * DEG_TO_RAD;
100     // FG_Latitude  = (  61.17 ) * DEG_TO_RAD;
101     // FG_Runway_altitude = (0);
102     // FG_Altitude = FG_Runway_altitude + 3.758099;
103
104     // Initial Position at (HSP) Hot Springs, VA
105     // FG_Longitude = (-79.8338964 + 0.01) * DEG_TO_RAD;
106     // FG_Latitude  = ( 37.9514564 + 0.008) * DEG_TO_RAD;
107     // FG_Runway_altitude = (3792 + 1300);
108     // FG_Altitude = FG_Runway_altitude + 3.758099;
109     
110     // Initial Position at (ANE) Anoka County airport
111     // FG_Longitude = -93.2113889 * DEG_TO_RAD;
112     // FG_Latitude  = 45.145 * DEG_TO_RAD;
113     // FG_Runway_altitude = 912;
114     // FG_Altitude = FG_Runway_altitude + 3.758099;
115
116     // Initial Position north of the city of Globe
117     // FG_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD;
118     // FG_Latitude  = (  120625.64 / 3600.0 ) * DEG_TO_RAD;
119     // FG_Longitude = ( -397867.44 / 3600.0 ) * DEG_TO_RAD;
120     // FG_Latitude  = (  119548.21 / 3600.0 ) * DEG_TO_RAD;
121     // FG_Altitude = 0.0 + 3.758099;
122
123     // Initial Position near where I used to live in Globe, AZ
124     // FG_Longitude = ( -398757.6 / 3600.0 ) * DEG_TO_RAD;
125     // FG_Latitude  = (  120160.0 / 3600.0 ) * DEG_TO_RAD;
126     // FG_Runway_altitude = 4000.0;
127     // FG_Altitude = FG_Runway_altitude + 3.758099;
128
129     // Initial Position: 10125 Jewell St. NE
130     // FG_Longitude = ( -93.15 ) * DEG_TO_RAD;
131     // FG_Latitude  = (  45.15 ) * DEG_TO_RAD;
132     // FG_Runway_altitude = 950.0;
133     // FG_Altitude = FG_Runway_altitude + 3.758099;
134
135     // Initial Position: Somewhere near the Grand Canyon
136     // FG_Longitude = ( -112.5 ) * DEG_TO_RAD;
137     // FG_Latitude  = (  36.5 ) * DEG_TO_RAD;
138     // FG_Runway_altitude = 8000.0;
139     // FG_Altitude = FG_Runway_altitude + 3.758099;
140
141     // Initial Position: (GCN) Grand Canyon Airport, AZ
142     // FG_Longitude = ( -112.1469647 ) * DEG_TO_RAD;
143     // FG_Latitude  = (   35.9523539 ) * DEG_TO_RAD;
144     // FG_Runway_altitude = 6606.0;
145     // FG_Altitude = FG_Runway_altitude + 3.758099;
146
147     // Initial Position: Jim Brennon's Kingmont Observatory
148     // FG_Longitude = ( -121.1131667 ) * DEG_TO_RAD;
149     // FG_Latitude  = (   38.8293917 ) * DEG_TO_RAD;
150     // FG_Runway_altitude = 920.0;
151     // FG_Altitude = FG_Runway_altitude + 3.758099;
152
153     // probably interesting for european team members
154     // That is: If I can get the scenery to work -;) (Durk)
155  
156     // Initial Position: Groningen Airport Eelde, the netherlands
157     // FG_Longitude = ( 6.583333 ) * DEG_TO_RAD;
158     // FG_Latitude  = (   53.125 ) * DEG_TO_RAD;
159     // FG_Runway_altitude = 920.0;
160     // FG_Altitude = FG_Runway_altitude + 3.758099;
161  
162     // Initial Position: Schiphol Amsterdam Airport, the netherlands
163     // FG_Longitude = ( -4.7641667 ) * DEG_TO_RAD;
164     // FG_Latitude  = (   52.308056 ) * DEG_TO_RAD;
165     // FG_Runway_altitude = 920.0;
166     // FG_Altitude = FG_Runway_altitude + 3.758099;
167
168     // Eclipse Watching w73.5 n10 (approx) 18:00 UT
169     // FG_Longitude = ( -73.5 ) * DEG_TO_RAD;
170     // FG_Latitude  = (  10.0 ) * DEG_TO_RAD;
171     // FG_Runway_altitude = 0.0;
172     // FG_Altitude = FG_Runway_altitude + 3.758099;
173
174     // Test Position
175     // FG_Longitude = ( -109.5 ) * DEG_TO_RAD;
176     // FG_Latitude  = (  32.5 ) * DEG_TO_RAD;
177     // FG_Runway_altitude = (2646 + 2000);
178     // FG_Altitude = FG_Runway_altitude + 3.758099;
179
180     if ( strlen(o->airport_id) ) {
181         fgAIRPORTS airports;
182         fgAIRPORT a;
183
184         fgPrintf( FG_GENERAL, FG_INFO, 
185                   "Attempting to set starting position from airport code %s.\n",
186                   o->airport_id);
187
188         airports.load("Airports");
189         a = airports.search(o->airport_id);
190         if ( strcmp(a.id, "none") == 0 ) {
191             fgPrintf( FG_GENERAL, FG_INFO, 
192                       "Failed to find %s in database.\n", o->airport_id);
193         } else {
194             FG_Longitude = ( a.longitude ) * DEG_TO_RAD;
195             FG_Latitude  = ( a.latitude ) * DEG_TO_RAD;
196             FG_Runway_altitude = ( a.elevation + 300 );
197             FG_Altitude = FG_Runway_altitude + 3.758099;
198         }           
199     }
200     
201     fgPrintf( FG_GENERAL, FG_INFO, 
202               "Initial position is: (%.4f, %.4f, %.2f)\n", 
203               FG_Longitude * RAD_TO_DEG, FG_Latitude * RAD_TO_DEG, 
204               FG_Altitude * FEET_TO_METER);
205 }
206
207
208 // General house keeping initializations
209 int fgInitGeneral( void ) {
210     fgGENERAL *g;
211
212     g = &general;
213
214     // determine the fg root path.  
215     if( !(g->root_dir) ) { 
216         // If not set by command line test for environmental var..
217         g->root_dir = getenv("FG_ROOT");
218         if ( !g->root_dir ) { 
219             // No root path set? Then assume, we will exit if this is
220             // wrong when looking for support files.
221             fgPrintf( FG_GENERAL, FG_EXIT, "%s %s\n",
222                       "Cannot continue without environment variable FG_ROOT",
223                       "being defined.");
224         }
225     }
226     fgPrintf( FG_GENERAL, FG_INFO, "FG_ROOT = %s\n\n", g->root_dir);
227
228     fgPrintf( FG_GENERAL, FG_INFO, "General Initialization\n" );
229     fgPrintf( FG_GENERAL, FG_INFO, "======= ==============\n" );
230
231     // seed the random number generater
232     fg_srandom();
233
234     return ( 1 ); 
235 }
236
237
238 // This is the top level init routine which calls all the other
239 // initialization routines.  If you are adding a subsystem to flight
240 // gear, its initialization call should located in this routine.
241 // Returns non-zero if a problem encountered.
242 int fgInitSubsystems( void ) {
243     double cur_elev;
244
245     fgFLIGHT *f;
246     struct fgLIGHT *l;
247     struct fgTIME *t;
248     struct fgVIEW *v;
249
250     l = &cur_light_params;
251     t = &cur_time_params;
252     v = &current_view;
253
254     fgPrintf( FG_GENERAL, FG_INFO, "Initialize Subsystems\n");
255     fgPrintf( FG_GENERAL, FG_INFO, "========== ==========\n");
256
257     // The following section sets up the flight model EOM parameters
258     // and should really be read in from one or more files.
259
260     // Must happen before any of the flight model or control
261     // parameters are set
262
263     fgAircraftInit();   // In the future this might not be the case.
264     f = current_aircraft.flight;
265
266     // set the initial position
267     fgInitPosition();
268
269     // Initial Velocity
270     FG_V_north = 0.0;   //  7.287719E+00
271     FG_V_east  = 0.0;   //  1.521770E+03
272     FG_V_down  = 0.0;   // -1.265722E-05
273
274     // Initial Orientation
275     FG_Phi   = -2.658474E-06;
276     FG_Theta =  7.401790E-03;
277     FG_Psi   =  270.0 * DEG_TO_RAD;
278
279     // Initial Angular B rates
280     FG_P_body = 7.206685E-05;
281     FG_Q_body = 0.000000E+00;
282     FG_R_body = 9.492658E-05;
283
284     FG_Earth_position_angle = 0.000000E+00;
285
286     // Mass properties and geometry values
287     FG_Mass = 8.547270E+01;
288     FG_I_xx = 1.048000E+03;
289     FG_I_yy = 3.000000E+03;
290     FG_I_zz = 3.530000E+03;
291     FG_I_xz = 0.000000E+00;
292
293     // CG position w.r.t. ref. point
294     FG_Dx_cg = 0.000000E+00;
295     FG_Dy_cg = 0.000000E+00;
296     FG_Dz_cg = 0.000000E+00;
297
298     // Set initial position and slew parameters
299     // fgSlewInit(-398391.3, 120070.41, 244, 3.1415);  // GLOBE Airport
300     // fgSlewInit(-335340,162540, 15, 4.38);
301     // fgSlewInit(-398673.28,120625.64, 53, 4.38);
302
303     // Initialize the event manager
304     fgEventInit();
305
306     // Dump event stats every 60 seconds
307     fgEventRegister( "fgEventPrintStats()", fgEventPrintStats,
308                      FG_EVENT_READY, 60000 );
309
310     // Initialize "time"
311     fgTimeInit(t);
312     fgTimeUpdate(f, t);
313
314     // fgViewUpdate() needs the sun in the right place, while
315     // fgUpdateSunPos() needs to know the view position.  I'll get
316     // around this interdependency for now by calling fgUpdateSunPos()
317     // once, then moving on with normal initialization.
318     fgUpdateSunPos();
319
320     // Initialize view parameters
321     fgViewInit(v);
322     fgViewUpdate(f, v, l);
323
324     // Initialize Lighting interpolation tables
325     fgLightInit();
326
327     // update the lighting parameters (based on sun angle)
328     fgEventRegister( "fgLightUpdate()", fgLightUpdate,
329                      FG_EVENT_READY, 30000 );
330
331     // Initialize the weather modeling subsystem
332     fgWeatherInit();
333
334     // update the weather for our current position
335     fgEventRegister( "fgWeatherUpdate()", fgWeatherUpdate,
336                      FG_EVENT_READY, 120000 );
337
338     // Initialize the Cockpit subsystem
339     if( fgCockpitInit( &current_aircraft )) {
340         // Cockpit initialized ok.
341     } else {
342         fgPrintf( FG_GENERAL, FG_EXIT, "Error in Cockpit initialization!\n" );
343     }
344
345     // Initialize the orbital elements of sun, moon and mayor planets
346     fgSolarSystemInit(*t);
347
348     // Initialize the Stars subsystem
349     if( fgStarsInit() ) {
350         // Stars initialized ok.
351     } else {
352         fgPrintf( FG_GENERAL, FG_EXIT, "Error in Stars initialization!\n" );
353     }
354
355     // Initialize the planetary subsystem
356     fgEventRegister("fgPlanetsInit()", fgPlanetsInit, FG_EVENT_READY, 600000);
357
358     // Initialize the sun's position 
359     fgEventRegister("fgSunInit()", fgSunInit, FG_EVENT_READY, 30000 );
360
361     // Intialize the moon's position
362     fgEventRegister( "fgMoonInit()", fgMoonInit, FG_EVENT_READY, 600000 );
363
364     // Initialize the "sky"
365     fgSkyInit();
366
367     // Initialize the Scenery Management subsystem
368     if ( fgSceneryInit() ) {
369         // Scenery initialized ok.
370     } else {
371         fgPrintf( FG_GENERAL, FG_EXIT, "Error in Scenery initialization!\n" );
372     }
373
374
375     if( fgTileMgrInit() ) {
376         // Load the local scenery data
377         fgTileMgrUpdate();
378     } else {
379         fgPrintf( FG_GENERAL, FG_EXIT, 
380                   "Error in Tile Manager initialization!\n" );
381     }
382
383     // I'm just sticking this here for now, it should probably move
384     // eventually
385     // cur_elev = mesh_altitude(FG_Longitude * RAD_TO_DEG * 3600.0,
386     //           FG_Latitude  * RAD_TO_DEG * 3600.0);
387     // fgPrintf( FG_GENERAL, FG_INFO,
388     //   "True ground elevation is %.2f meters here.\n",
389     //   cur_elev);
390
391     cur_elev = FG_Runway_altitude * FEET_TO_METER;
392     if ( cur_elev > -9990.0 ) {
393         FG_Runway_altitude = cur_elev * METER_TO_FEET;
394     }
395
396     if ( FG_Altitude < FG_Runway_altitude ) {
397         FG_Altitude = FG_Runway_altitude + 3.758099;
398     }
399
400     fgPrintf(FG_GENERAL, FG_INFO,
401              "Updated position (after elevation adj): (%.4f, %.4f, %.2f)\n",
402              FG_Latitude * RAD_TO_DEG, FG_Longitude * RAD_TO_DEG,
403              FG_Altitude * FEET_TO_METER);
404
405     // end of thing that I just stuck in that I should probably move
406                 
407     // Initialize the flight model subsystem data structures base on
408     // above values
409
410     fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ );
411
412     // To HUD or not to HUD  - Now a command line issue
413     //              show_hud = 0;
414
415     // Let's not show the instrument panel
416     displayInstruments = 0;
417
418     // Joystick support
419     if (fgJoystickInit(0) ) {
420         // Joystick initialized ok.
421     } else {
422         fgPrintf( FG_GENERAL, FG_EXIT, "Error in Joystick initialization!\n" );
423     }
424
425     // Autopilot init added here, by Jeff Goeke-Smith
426     fgAPInit(&current_aircraft);
427     
428     // One more try here to get the sky synced up
429     fgSkyColorsInit();
430
431     fgPrintf(FG_GENERAL, FG_INFO,"\n");
432
433     return(1);
434 }
435
436
437 // $Log$
438 // Revision 1.3  1998/04/25 15:11:11  curt
439 // Added an command line option to set starting position based on airport ID.
440 //
441 // Revision 1.2  1998/04/24 00:49:20  curt
442 // Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
443 // Trying out some different option parsing code.
444 // Some code reorganization.
445 //
446 // Revision 1.1  1998/04/22 13:25:44  curt
447 // C++ - ifing the code.
448 // Starting a bit of reorganization of lighting code.
449 //
450 // Revision 1.56  1998/04/18 04:11:28  curt
451 // Moved fg_debug to it's own library, added zlib support.
452 //
453 // Revision 1.55  1998/04/14 02:21:03  curt
454 // Incorporated autopilot heading hold contributed by:  Jeff Goeke-Smith
455 // <jgoeke@voyager.net>
456 //
457 // Revision 1.54  1998/04/08 23:35:36  curt
458 // Tweaks to Gnu automake/autoconf system.
459 //
460 // Revision 1.53  1998/04/03 22:09:06  curt
461 // Converting to Gnu autoconf system.
462 //
463 // Revision 1.52  1998/03/23 21:24:38  curt
464 // Source code formating tweaks.
465 //
466 // Revision 1.51  1998/03/14 00:31:22  curt
467 // Beginning initial terrain texturing experiments.
468 //
469 // Revision 1.50  1998/03/09 22:46:19  curt
470 // Minor tweaks.
471 //
472 // Revision 1.49  1998/02/23 19:07:59  curt
473 // Incorporated Durk's Astro/ tweaks.  Includes unifying the sun position
474 // calculation code between sun display, and other FG sections that use this
475 // for things like lighting.
476 //
477 // Revision 1.48  1998/02/21 14:53:15  curt
478 // Added Charlie's HUD changes.
479 //
480 // Revision 1.47  1998/02/19 13:05:53  curt
481 // Incorporated some HUD tweaks from Michelle America.
482 // Tweaked the sky's sunset/rise colors.
483 // Other misc. tweaks.
484 //
485 // Revision 1.46  1998/02/18 15:07:06  curt
486 // Tweaks to build with SGI OpenGL (and therefor hopefully other accelerated
487 // drivers will work.)
488 //
489 // Revision 1.45  1998/02/16 13:39:43  curt
490 // Miscellaneous weekend tweaks.  Fixed? a cache problem that caused whole
491 // tiles to occasionally be missing.
492 //
493 // Revision 1.44  1998/02/12 21:59:50  curt
494 // Incorporated code changes contributed by Charlie Hotchkiss
495 // <chotchkiss@namg.us.anritsu.com>
496 //
497 // Revision 1.43  1998/02/11 02:50:40  curt
498 // Minor changes.
499 //
500 // Revision 1.42  1998/02/09 22:56:58  curt
501 // Removed "depend" files from cvs control.  Other minor make tweaks.
502 //
503 // Revision 1.41  1998/02/09 15:07:50  curt
504 // Minor tweaks.
505 //
506 // Revision 1.40  1998/02/07 15:29:44  curt
507 // Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
508 // <chotchkiss@namg.us.anritsu.com>
509 //
510 // Revision 1.39  1998/02/03 23:20:25  curt
511 // Lots of little tweaks to fix various consistency problems discovered by
512 // Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
513 // passed arguments along to the real printf().  Also incorporated HUD changes
514 // by Michele America.
515 //
516 // Revision 1.38  1998/02/02 20:53:58  curt
517 // Incorporated Durk's changes.
518 //
519 // Revision 1.37  1998/02/01 03:39:54  curt
520 // Minor tweaks.
521 //
522 // Revision 1.36  1998/01/31 00:43:13  curt
523 // Added MetroWorks patches from Carmen Volpe.
524 //
525 // Revision 1.35  1998/01/27 00:47:57  curt
526 // Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
527 // system and commandline/config file processing code.
528 //
529 // Revision 1.34  1998/01/22 02:59:37  curt
530 // Changed #ifdef FILE_H to #ifdef _FILE_H
531 //
532 // Revision 1.33  1998/01/21 21:11:34  curt
533 // Misc. tweaks.
534 //
535 // Revision 1.32  1998/01/19 19:27:08  curt
536 // Merged in make system changes from Bob Kuehne <rpk@sgi.com>
537 // This should simplify things tremendously.
538 //
539 // Revision 1.31  1998/01/19 18:40:32  curt
540 // Tons of little changes to clean up the code and to remove fatal errors
541 // when building with the c++ compiler.
542 //
543 // Revision 1.30  1998/01/13 00:23:09  curt
544 // Initial changes to support loading and management of scenery tiles.  Note,
545 // there's still a fair amount of work left to be done.
546 //
547 // Revision 1.29  1998/01/08 02:22:08  curt
548 // Beginning to integrate Tile management subsystem.
549 //
550 // Revision 1.28  1998/01/07 03:18:58  curt
551 // Moved astronomical stuff from .../Src/Scenery to .../Src/Astro/
552 //
553 // Revision 1.27  1998/01/05 18:44:35  curt
554 // Add an option to advance/decrease time from keyboard.
555 //
556 // Revision 1.26  1997/12/30 23:09:04  curt
557 // Tweaking initialization sequences.
558 //
559 // Revision 1.25  1997/12/30 22:22:33  curt
560 // Further integration of event manager.
561 //
562 // Revision 1.24  1997/12/30 20:47:44  curt
563 // Integrated new event manager with subsystem initializations.
564 //
565 // Revision 1.23  1997/12/30 16:36:50  curt
566 // Merged in Durk's changes ...
567 //
568 // Revision 1.22  1997/12/19 23:34:05  curt
569 // Lot's of tweaking with sky rendering and lighting.
570 //
571 // Revision 1.21  1997/12/19 16:45:00  curt
572 // Working on scene rendering order and options.
573 //
574 // Revision 1.20  1997/12/18 23:32:33  curt
575 // First stab at sky dome actually starting to look reasonable. :-)
576 //
577 // Revision 1.19  1997/12/17 23:13:36  curt
578 // Began working on rendering a sky.
579 //
580 // Revision 1.18  1997/12/15 23:54:49  curt
581 // Add xgl wrappers for debugging.
582 // Generate terrain normals on the fly.
583 //
584 // Revision 1.17  1997/12/15 20:59:09  curt
585 // Misc. tweaks.
586 //
587 // Revision 1.16  1997/12/12 19:52:48  curt
588 // Working on lightling and material properties.
589 //
590 // Revision 1.15  1997/12/11 04:43:55  curt
591 // Fixed sun vector and lighting problems.  I thing the moon is now lit
592 // correctly.
593 //
594 // Revision 1.14  1997/12/10 22:37:47  curt
595 // Prepended "fg" on the name of all global structures that didn't have it yet.
596 // i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
597 //
598 // Revision 1.13  1997/11/25 19:25:32  curt
599 // Changes to integrate Durk's moon/sun code updates + clean up.
600 //
601 // Revision 1.12  1997/11/15 18:16:35  curt
602 // minor tweaks.
603 //
604 // Revision 1.11  1997/10/30 12:38:42  curt
605 // Working on new scenery subsystem.
606 //
607 // Revision 1.10  1997/10/25 03:24:23  curt
608 // Incorporated sun, moon, and star positioning code contributed by Durk Talsma.
609 //
610 // Revision 1.9  1997/09/23 00:29:39  curt
611 // Tweaks to get things to compile with gcc-win32.
612 //
613 // Revision 1.8  1997/09/22 14:44:20  curt
614 // Continuing to try to align stars correctly.
615 //
616 // Revision 1.7  1997/09/16 15:50:30  curt
617 // Working on star alignment and time issues.
618 //
619 // Revision 1.6  1997/09/05 14:17:30  curt
620 // More tweaking with stars.
621 //
622 // Revision 1.5  1997/09/04 02:17:36  curt
623 // Shufflin' stuff.
624 //
625 // Revision 1.4  1997/08/27 21:32:26  curt
626 // Restructured view calculation code.  Added stars.
627 //
628 // Revision 1.3  1997/08/27 03:30:19  curt
629 // Changed naming scheme of basic shared structures.
630 //
631 // Revision 1.2  1997/08/25 20:27:23  curt
632 // Merged in initial HUD and Joystick code.
633 //
634 // Revision 1.1  1997/08/23 01:46:20  curt
635 // Initial revision.
636 //
637