]> git.mxchange.org Git - flightgear.git/blobdiff - Main/fg_init.c
Shufflin' stuff.
[flightgear.git] / Main / fg_init.c
index 933cfc259b031707d3cd08b4402accf3fae1693a..36f368c2c92e5fe5eb2fa144cc45d552950d9b39 100644 (file)
 #include <stdlib.h>
 
 #include "fg_init.h"
+#include "views.h"
 
 #include "../constants.h"
 #include "../general.h"
 
 #include "../Aircraft/aircraft.h"
+#include "../Cockpit/cockpit.h"
+#include "../Joystick/joystick.h"
 #include "../Math/fg_random.h"
 #include "../Scenery/mesh.h"
 #include "../Scenery/scenery.h"
+#include "../Scenery/stars.h"
 #include "../Time/sunpos.h"
 #include "../Weather/weather.h"
 
 
+extern int show_hud;             /* HUD state */
+
+
 /* General house keeping initializations */
 
 void fgInitGeneral( void ) {
-    struct general_params *g;
+    struct GENERAL *g;
 
     g = &general;
 
@@ -67,9 +74,12 @@ void fgInitGeneral( void ) {
 void fgInitSubsystems( void ) {
     double cur_elev;
 
-    struct flight_params *f;
+    struct FLIGHT *f;
+    struct VIEW *v;
 
     f = &current_aircraft.flight;
+    v = &current_view;
+
 
     /****************************************************************
      * The following section sets up the flight model EOM parameters and 
@@ -86,7 +96,8 @@ void fgInitSubsystems( void ) {
     FG_Latitude  = (  120070.41 / 3600.0 ) * DEG_TO_RAD;
     FG_Longitude = ( -398391.28 / 3600.0 ) * DEG_TO_RAD;
     FG_Altitude = FG_Runway_altitude + 3.758099;
-
+    /* FG_Altitude = 20000; */
+    
     /* Initial Position north of the city of Globe */
     /* FG_Latitude  = (  120625.64 / 3600.0 ) * DEG_TO_RAD; */
     /* FG_Longitude = ( -398673.28 / 3600.0 ) * DEG_TO_RAD; */
@@ -132,11 +143,24 @@ void fgInitSubsystems( void ) {
     /* fgSlewInit(-398673.28,120625.64, 53, 4.38); */
 
     /* Initialize shared sun position and sun_vec */
-    fgUpdateSunPos();
+    fgUpdateSunPos(scenery.center);
+
+    /* Initialize view parameters */
+    fgViewInit(v);
 
     /* Initialize the weather modeling subsystem */
     fgWeatherInit();
 
+    /* Initialize the Cockpit subsystem */
+    if( fgCockpitInit( current_aircraft ) == NULL )
+    {
+       printf( "Error in Cockpit initialization!\n" );
+       exit( 1 );
+    }
+
+    /* Initialize the Stars subsystem  */
+    fgStarsInit();
+
     /* Initialize the Scenery Management subsystem */
     fgSceneryInit();
 
@@ -166,11 +190,29 @@ void fgInitSubsystems( void ) {
     /* Initialize the flight model subsystem data structures base on
      * above values */
     fgFlightModelInit( FG_LARCSIM, f, 1.0 / DEFAULT_MODEL_HZ );
+
+    /* To HUD or not to HUD */
+    show_hud = 1;
+
+    /* Joystick support */
+    fgJoystickInit( 0 );
 }
 
 
 /* $Log$
-/* Revision 1.1  1997/08/23 01:46:20  curt
-/* Initial revision.
+/* Revision 1.5  1997/09/04 02:17:36  curt
+/* Shufflin' stuff.
 /*
+ * Revision 1.4  1997/08/27 21:32:26  curt
+ * Restructured view calculation code.  Added stars.
+ *
+ * Revision 1.3  1997/08/27 03:30:19  curt
+ * Changed naming scheme of basic shared structures.
+ *
+ * Revision 1.2  1997/08/25 20:27:23  curt
+ * Merged in initial HUD and Joystick code.
+ *
+ * Revision 1.1  1997/08/23 01:46:20  curt
+ * Initial revision.
+ *
  */