When the clock is frozen, set delta time to 0 so that the subsystems
won't keep updating themselves; that effectively freezes the instrumentation.
This commit is contained in:
parent
3da2de39fc
commit
c542559097
1 changed files with 13 additions and 11 deletions
|
@ -908,17 +908,6 @@ static const double alt_adjust_m = alt_adjust_ft * SG_FEET_TO_METER;
|
|||
// for the next move and update the display?
|
||||
static void fgMainLoop( void ) {
|
||||
|
||||
// Update the elapsed time.
|
||||
static bool first_time = true;
|
||||
if ( first_time ) {
|
||||
last_time_stamp.stamp();
|
||||
first_time = false;
|
||||
}
|
||||
current_time_stamp.stamp();
|
||||
delta_time_sec = double(current_time_stamp - last_time_stamp) / 1000000.0;
|
||||
last_time_stamp = current_time_stamp;
|
||||
globals->inc_sim_time_sec( delta_time_sec );
|
||||
|
||||
static const SGPropertyNode *longitude
|
||||
= fgGetNode("/position/longitude-deg");
|
||||
static const SGPropertyNode *latitude
|
||||
|
@ -930,6 +919,19 @@ static void fgMainLoop( void ) {
|
|||
static const SGPropertyNode *cur_time_override
|
||||
= fgGetNode("/sim/time/cur-time-override", true);
|
||||
|
||||
// Update the elapsed time.
|
||||
static bool first_time = true;
|
||||
if ( first_time ) {
|
||||
last_time_stamp.stamp();
|
||||
first_time = false;
|
||||
}
|
||||
current_time_stamp.stamp();
|
||||
delta_time_sec = double(current_time_stamp - last_time_stamp) / 1000000.0;
|
||||
if (clock_freeze->getBoolValue())
|
||||
delta_time_sec = 0;
|
||||
last_time_stamp = current_time_stamp;
|
||||
globals->inc_sim_time_sec( delta_time_sec );
|
||||
|
||||
static long remainder = 0;
|
||||
long elapsed;
|
||||
#ifdef FANCY_FRAME_COUNTER
|
||||
|
|
Loading…
Add table
Reference in a new issue