#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;
void fgInitSubsystems( void ) {
double cur_elev;
- struct flight_params *f;
+ struct FLIGHT *f;
+ struct VIEW *v;
f = ¤t_aircraft.flight;
+ v = ¤t_view;
+
/****************************************************************
* The following section sets up the flight model EOM parameters and
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; */
/* 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();
/* 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.
+ *
*/