From 7ada12ed094ddb822122c87e0aabee84d8ba0adf Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 16 Mar 2000 04:15:22 +0000 Subject: [PATCH] Updates for ssg solarsystem/sky model. Includes changes to Time, Light, and initialization sequences. --- src/Main/bfi.cxx | 5 +- src/Main/fg_init.cxx | 6 +- src/Main/keyboard.cxx | 4 +- src/Main/main.cxx | 165 +++++++++++++++++++----------------------- 4 files changed, 80 insertions(+), 100 deletions(-) diff --git a/src/Main/bfi.cxx b/src/Main/bfi.cxx index 10978d791..5d0695118 100644 --- a/src/Main/bfi.cxx +++ b/src/Main/bfi.cxx @@ -196,8 +196,9 @@ FGBFI::setTimeGMT (time_t time) // and solar system current_options.set_time_offset(time); current_options.set_time_offset_type(fgOPTIONS::FG_TIME_GMT_ABSOLUTE); - FGTime::cur_time_params->init(*cur_fdm_state); - FGTime::cur_time_params->update(*cur_fdm_state); + FGTime::cur_time_params->init( cur_fdm_state->get_Longitude(), + cur_fdm_state->get_Latitude() ); + FGTime::cur_time_params->update( cur_fdm_state->get_Longitude() ); needReinit(); } diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 78dac6cd9..a145bcbb9 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -224,8 +224,6 @@ bool fgInitGeneral( void ) { // gear, its initialization call should located in this routine. // Returns non-zero if a problem encountered. bool fgInitSubsystems( void ) { - FGTime::cur_time_params = new FGTime(); - fgLIGHT *l = &cur_light_params; FGTime *t = FGTime::cur_time_params; @@ -374,8 +372,8 @@ bool fgInitSubsystems( void ) { fgEVENT::FG_EVENT_READY, 60000 ); // Initialize the time dependent variables - t->init(*cur_fdm_state); - t->update(*cur_fdm_state); + t->init( cur_fdm_state->get_Longitude(), cur_fdm_state->get_Latitude() ); + t->update( cur_fdm_state->get_Longitude() ); // Initialize view parameters FG_LOG( FG_GENERAL, FG_DEBUG, "Before current_view.init()"); diff --git a/src/Main/keyboard.cxx b/src/Main/keyboard.cxx index 90efdb5fd..1e45b622d 100644 --- a/src/Main/keyboard.cxx +++ b/src/Main/keyboard.cxx @@ -46,7 +46,6 @@ #include #include -#include #include #include #include @@ -71,8 +70,7 @@ extern void NewHeading( puObject *cb ); // Force an update of the sky and lighting parameters static void local_update_sky_and_lighting_params( void ) { - // fgSunInit(); - SolarSystem::theSolarSystem->rebuild(); + FGTime::cur_time_params->updateLocal(); cur_light_params.Update(); } diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 6f6217f41..501ad143e 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -88,9 +88,7 @@ #include #include #include -#include -#include -#include +#include #include