]> git.mxchange.org Git - flightgear.git/commitdiff
When the clock is frozen, set delta time to 0 so that the subsystems
authordavid <david>
Fri, 27 Sep 2002 22:02:48 +0000 (22:02 +0000)
committerdavid <david>
Fri, 27 Sep 2002 22:02:48 +0000 (22:02 +0000)
won't keep updating themselves; that effectively freezes the
instrumentation.

src/Main/main.cxx

index 67f97a319d7c559c73478d27f69ea54ca17636a5..b8bbb5ccd66da7d11df7feec2b2c700aeb65122d 100644 (file)
@@ -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