From: david Date: Fri, 27 Sep 2002 22:02:48 +0000 (+0000) Subject: When the clock is frozen, set delta time to 0 so that the subsystems X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c5425590975dbbebd83916db17b3a1996f506e16;p=flightgear.git When the clock is frozen, set delta time to 0 so that the subsystems won't keep updating themselves; that effectively freezes the instrumentation. --- 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