From e4295262d0e8f446fe3c4b8d1ce14048e968252c Mon Sep 17 00:00:00 2001
From: curt <curt>
Date: Fri, 21 Nov 2003 23:35:25 +0000
Subject: [PATCH] Currently, when the sim pauses, all IO is also halted.  To me
 it generally makes more sense to keep I/O running.  That way remote telnet
 connections will still respond, and the sim can still accept and send data. 
 This also allows a remote script or gui to pause and (more importantly) be
 able to the unpause the sim.

---
 src/Main/main.cxx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/Main/main.cxx b/src/Main/main.cxx
index c761df4ae..7d9ea4dfc 100644
--- a/src/Main/main.cxx
+++ b/src/Main/main.cxx
@@ -113,6 +113,7 @@ sgVec3 rway_ols;
 float scene_nearplane = 0.5f;
 float scene_farplane = 120000.0f;
 
+static double real_delta_time_sec = 0.0;
 static double delta_time_sec = 0.0;
 
 glPointParameterfProc glPointParameterfPtr = 0;
@@ -963,10 +964,13 @@ static void fgMainLoop( void ) {
         current_time_stamp.stamp();
     }
 
-    delta_time_sec = double(current_time_stamp - last_time_stamp) / 1000000.0;
+    real_delta_time_sec
+        = double(current_time_stamp - last_time_stamp) / 1000000.0;
     if ( clock_freeze->getBoolValue() ) {
         delta_time_sec = 0;
-    } 
+    } else {
+        delta_time_sec = real_delta_time_sec;
+    }
     last_time_stamp = current_time_stamp;
     globals->inc_sim_time_sec( delta_time_sec );
     SGAnimation::set_sim_time_sec( globals->get_sim_time_sec() );
@@ -1136,7 +1140,7 @@ static void fgMainLoop( void ) {
     }
 
     // Do any I/O channel work that might need to be done
-    globals->get_io()->update( delta_time_sec );
+    globals->get_io()->update( real_delta_time_sec );
 
     // see if we need to load any deferred-load textures
     globals->get_matlib()->load_next_deferred();