]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Add a *really* crude model of ITT, Oil Temp, and Oil Pressure. This
[flightgear.git] / src / Main / main.cxx
index 276892f3201cf5013648fd75f6df6d9bebd76341..0d43799a6dc33adee1bc5ed70861ac01c14cdff5 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Written by Curtis Olson, started May 1997.
 //
-// Copyright (C) 1997 - 2002  Curtis L. Olson  - curt@flightgear.org
+// Copyright (C) 1997 - 2002  Curtis L. Olson  - http://www.flightgear.org/~curt
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
@@ -216,7 +216,7 @@ static void fgMainLoop( void ) {
     // static const SGPropertyNode *replay_master
     //     = fgGetNode("/sim/freeze/replay", true);
 
-    SGCloudLayer::enable_bump_mapping = fgGetBool("/sim/rendering/bump-mapping",true);
+    SGCloudLayer::enable_bump_mapping = fgGetBool("/sim/rendering/bump-mapping");
 
     // Update the elapsed time.
     static bool first_time = true;
@@ -240,6 +240,18 @@ static void fgMainLoop( void ) {
 
     real_delta_time_sec
         = double(current_time_stamp - last_time_stamp) / 1000000.0;
+    // round the real time down to a multiple of 1/model-hz.
+    // this way all systems are updated the _same_ amount of dt.
+    {
+      static double rem = 0.0;
+      real_delta_time_sec += rem;
+      double hz = model_hz;
+      double nit = floor(real_delta_time_sec*hz);
+      rem = real_delta_time_sec - nit/hz;
+      real_delta_time_sec = nit/hz;
+    }
+
+
     if ( clock_freeze->getBoolValue() ) {
         delta_time_sec = 0;
     } else {