From aad1de2ee5d907dd01dae5c73c3520202a93ed97 Mon Sep 17 00:00:00 2001 From: curt Date: Sun, 10 Feb 2002 04:18:10 +0000 Subject: [PATCH] Changes to match simgear changes which allow overriding the current clock time. --- src/ATC/atis.hxx | 2 +- src/Main/main.cxx | 3 +++ src/Navaids/nav.hxx | 2 +- src/Network/native_fdm.cxx | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ATC/atis.hxx b/src/ATC/atis.hxx index 5809c1b59..b84cfa2d3 100644 --- a/src/ATC/atis.hxx +++ b/src/ATC/atis.hxx @@ -113,7 +113,7 @@ operator >> ( istream& in, FGATIS& a ) static double julian_date = 0; static const double MJD0 = 2415020.0; if ( first_time ) { - julian_date = sgTimeCurrentMJD( 0 ) + MJD0; + julian_date = sgTimeCurrentMJD() + MJD0; first_time = false; } diff --git a/src/Main/main.cxx b/src/Main/main.cxx index e06a75e90..771a671bd 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -999,6 +999,8 @@ static void fgMainLoop( void ) { = fgGetNode("/position/latitude-deg"); static const SGPropertyNode *altitude = fgGetNode("/position/altitude-ft"); + static const SGPropertyNode *cur_time_override + = fgGetNode("/sim/time/cur-time-override", true); static long remainder = 0; long elapsed; @@ -1081,6 +1083,7 @@ static void fgMainLoop( void ) { t->update( longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS, latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS, + cur_time_override->getLongValue(), globals->get_warp() ); if ( globals->get_warp_delta() != 0 ) { diff --git a/src/Navaids/nav.hxx b/src/Navaids/nav.hxx index 5a5211304..ae8cf431b 100644 --- a/src/Navaids/nav.hxx +++ b/src/Navaids/nav.hxx @@ -107,7 +107,7 @@ operator >> ( istream& in, FGNav& n ) static double julian_date = 0; static const double MJD0 = 2415020.0; if ( first_time ) { - julian_date = sgTimeCurrentMJD( 0 ) + MJD0; + julian_date = sgTimeCurrentMJD() + MJD0; first_time = false; } diff --git a/src/Network/native_fdm.cxx b/src/Network/native_fdm.cxx index 90e54b44b..b6e2c9765 100644 --- a/src/Network/native_fdm.cxx +++ b/src/Network/native_fdm.cxx @@ -168,6 +168,10 @@ static void net2global( FGNetFDM *net, FGInterface *global ) { cur_fdm_state->_set_V_calibrated_kts( net->vcas ); 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 ); if ( net->warp != last_warp ) { fgUpdateSkyAndLightingParams(); -- 2.39.5