From c5425590975dbbebd83916db17b3a1996f506e16 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 27 Sep 2002 22:02:48 +0000 Subject: [PATCH] When the clock is frozen, set delta time to 0 so that the subsystems won't keep updating themselves; that effectively freezes the instrumentation. --- src/Main/main.cxx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 67f97a319..b8bbb5ccd 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -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 -- 2.39.5