1
0
Fork 0

Changes to match simgear changes which allow overriding the current

clock time.
This commit is contained in:
curt 2002-02-10 04:18:10 +00:00
parent 61d31ab822
commit aad1de2ee5
4 changed files with 9 additions and 2 deletions

View file

@ -113,7 +113,7 @@ operator >> ( istream& in, FGATIS& a )
static double julian_date = 0; static double julian_date = 0;
static const double MJD0 = 2415020.0; static const double MJD0 = 2415020.0;
if ( first_time ) { if ( first_time ) {
julian_date = sgTimeCurrentMJD( 0 ) + MJD0; julian_date = sgTimeCurrentMJD() + MJD0;
first_time = false; first_time = false;
} }

View file

@ -999,6 +999,8 @@ static void fgMainLoop( void ) {
= fgGetNode("/position/latitude-deg"); = fgGetNode("/position/latitude-deg");
static const SGPropertyNode *altitude static const SGPropertyNode *altitude
= fgGetNode("/position/altitude-ft"); = fgGetNode("/position/altitude-ft");
static const SGPropertyNode *cur_time_override
= fgGetNode("/sim/time/cur-time-override", true);
static long remainder = 0; static long remainder = 0;
long elapsed; long elapsed;
@ -1081,6 +1083,7 @@ static void fgMainLoop( void ) {
t->update( longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS, t->update( longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS,
latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS, latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS,
cur_time_override->getLongValue(),
globals->get_warp() ); globals->get_warp() );
if ( globals->get_warp_delta() != 0 ) { if ( globals->get_warp_delta() != 0 ) {

View file

@ -107,7 +107,7 @@ operator >> ( istream& in, FGNav& n )
static double julian_date = 0; static double julian_date = 0;
static const double MJD0 = 2415020.0; static const double MJD0 = 2415020.0;
if ( first_time ) { if ( first_time ) {
julian_date = sgTimeCurrentMJD( 0 ) + MJD0; julian_date = sgTimeCurrentMJD() + MJD0;
first_time = false; first_time = false;
} }

View file

@ -168,6 +168,10 @@ static void net2global( FGNetFDM *net, FGInterface *global ) {
cur_fdm_state->_set_V_calibrated_kts( net->vcas ); cur_fdm_state->_set_V_calibrated_kts( net->vcas );
cur_fdm_state->_set_Climb_Rate( net->climb_rate ); cur_fdm_state->_set_Climb_Rate( net->climb_rate );
if ( ! net->cur_time ) {
fgSetLong("/sim/time/cur-time-override", net->cur_time);
}
globals->set_warp( net->warp ); globals->set_warp( net->warp );
if ( net->warp != last_warp ) { if ( net->warp != last_warp ) {
fgUpdateSkyAndLightingParams(); fgUpdateSkyAndLightingParams();