]> git.mxchange.org Git - flightgear.git/blobdiff - Main/fg_init.c
Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
[flightgear.git] / Main / fg_init.c
index 518ffd60d8cffcead9e889dc8d329533f736a1c8..40391a5fb325f8758cc382dfe5ef124169c177b3 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <Aircraft/aircraft.h>
 #include <Astro/moon.h>
+#include <Astro/planets.h>
 #include <Astro/sky.h>
 #include <Astro/stars.h>
 #include <Astro/sun.h>
@@ -85,12 +86,11 @@ void fgInitGeneral( void ) {
 void fgInitSubsystems( void ) {
     double cur_elev;
 
-    struct fgFLIGHT *f;
+    fgFLIGHT *f;
     struct fgLIGHT *l;
     struct fgTIME *t;
     struct fgVIEW *v;
 
-    f = &current_aircraft.flight;
     l = &cur_light_params;
     t = &cur_time_params;
     v = &current_view;
@@ -103,18 +103,41 @@ void fgInitSubsystems( void ) {
      * should really be read in from one or more files.
      ****************************************************************/
 
+    /* Must happen before any of the flight model or control
+     * parameters are set */
+    fgAircraftInit();
+    f = current_aircraft.flight;
+
     /* Globe Aiport, AZ */
     FG_Runway_longitude = -398391.28;
     FG_Runway_latitude = 120070.41;
     FG_Runway_altitude = 3234.5;
     FG_Runway_heading = 102.0 * DEG_TO_RAD;
 
-    /* Initial Position at (P13) GLOBE airport */
+    /* Initial Position at (P13) Globe, AZ */
     FG_Longitude = ( -398391.28 / 3600.0 ) * DEG_TO_RAD;
     FG_Latitude  = (  120070.41 / 3600.0 ) * DEG_TO_RAD;
     FG_Runway_altitude = (3234.5 + 300);
     FG_Altitude = FG_Runway_altitude + 3.758099;
 
+    /* Initial Position at (E81) Superior, AZ */
+    /* FG_Longitude = ( -111.1270650 ) * DEG_TO_RAD; */
+    /* FG_Latitude  = (  33.2778339 ) * DEG_TO_RAD; */
+    /* FG_Runway_altitude = (2646 + 500); */
+    /* FG_Altitude = FG_Runway_altitude + 3.758099; */
+
+    /* Initial Position at (TUS) Tucson, AZ */
+    /* FG_Longitude = ( -110.9412597 ) * DEG_TO_RAD; */
+    /* FG_Latitude  = (  32.1162439 ) * DEG_TO_RAD; */
+    /* FG_Runway_altitude = (2641 + 0); */
+    /* FG_Altitude = FG_Runway_altitude + 3.758099; */
+
+    /* Initial Position at near Anchoraze, AK */
+    /* FG_Longitude = ( -150.00 ) * DEG_TO_RAD; */
+    /* FG_Latitude  = (  61.17 ) * DEG_TO_RAD; */
+    /* FG_Runway_altitude = (2641 + 07777); */
+    /* FG_Altitude = FG_Runway_altitude + 3.758099; */
+
     /* Initial Position at (SEZ) SEDONA airport */
     /* FG_Longitude = (-111.7884614 + 0.02) * DEG_TO_RAD; */
     /* FG_Latitude  = (  34.8486289 - 0.04) * DEG_TO_RAD; */
@@ -134,7 +157,7 @@ void fgInitSubsystems( void ) {
     /* FG_Altitude = FG_Runway_altitude + 3.758099; */
     
     /* Initial Position north of the city of Globe */
-    /* FGto do the install_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD; */
+    /* FG_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Latitude  = (  120625.64 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Longitude = ( -397867.44 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Latitude  = (  119548.21 / 3600.0 ) * DEG_TO_RAD; */
@@ -151,6 +174,12 @@ void fgInitSubsystems( void ) {
     /* FG_Latitude  = (  45.15 ) * DEG_TO_RAD; */
     /* FG_Altitude = FG_Runway_altitude + 3.758099; */
 
+    /* Initial Position: Somewhere near the Grand Canyon */
+    FG_Longitude = ( -112.5 ) * DEG_TO_RAD;
+    FG_Latitude  = (  36.5 ) * DEG_TO_RAD;
+    FG_Runway_altitude = 5000.0;
+    FG_Altitude = FG_Runway_altitude + 3.758099;
+
     /* A random test position */
     /* FG_Longitude = ( 88128.00 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Latitude  = ( 93312.00 / 3600.0 ) * DEG_TO_RAD; */
@@ -226,7 +255,7 @@ void fgInitSubsystems( void ) {
                     FG_EVENT_READY, 120000 );
 
     /* Initialize the Cockpit subsystem */
-    if( fgCockpitInit( current_aircraft ) == NULL ) {
+    if( fgCockpitInit( &current_aircraft ) == NULL ) {
        fgPrintf( FG_GENERAL, FG_EXIT, "Error in Cockpit initialization!\n" );
     }
 
@@ -236,8 +265,11 @@ void fgInitSubsystems( void ) {
     /* Initialize the Stars subsystem */
     fgStarsInit();
 
+    /* Initialize the planetary subsystem */
+    fgEventRegister("fgPlanetsInit()", fgPlanetsInit, FG_EVENT_READY, 600000);
+
     /* Initialize the sun's position */
-    fgEventRegister( "fgSunInit()", fgSunInit, FG_EVENT_READY, 600000 );
+    fgEventRegister( "fgSunInit()", fgSunInit, FG_EVENT_READY, 60000 );
 
     /* Intialize the moon's position */
     fgEventRegister( "fgMoonInit()", fgMoonInit, FG_EVENT_READY, 600000 );
@@ -296,9 +328,25 @@ void fgInitSubsystems( void ) {
 
 
 /* $Log$
-/* Revision 1.36  1998/01/31 00:43:13  curt
-/* Added MetroWorks patches from Carmen Volpe.
+/* Revision 1.40  1998/02/07 15:29:44  curt
+/* Incorporated HUD changes and struct/typedef changes from Charlie Hotchkiss
+/* <chotchkiss@namg.us.anritsu.com>
 /*
+ * Revision 1.39  1998/02/03 23:20:25  curt
+ * Lots of little tweaks to fix various consistency problems discovered by
+ * Solaris' CC.  Fixed a bug in fg_debug.c with how the fgPrintf() wrapper
+ * passed arguments along to the real printf().  Also incorporated HUD changes
+ * by Michele America.
+ *
+ * Revision 1.38  1998/02/02 20:53:58  curt
+ * Incorporated Durk's changes.
+ *
+ * Revision 1.37  1998/02/01 03:39:54  curt
+ * Minor tweaks.
+ *
+ * Revision 1.36  1998/01/31 00:43:13  curt
+ * Added MetroWorks patches from Carmen Volpe.
+ *
  * Revision 1.35  1998/01/27 00:47:57  curt
  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
  * system and commandline/config file processing code.