X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FTime%2FTimeManager.hxx;h=53dffd51b1caf9b952663e2370b3e574de606dd9;hb=9bd00a62facf50830e4eeccfbf8ce57f4c1f444f;hp=c0a89c39a036d548ae3bf677ab54dea0acaa40c9;hpb=50eb95dcadaf39d892212f2c5c6fe2459b190719;p=flightgear.git diff --git a/src/Time/TimeManager.hxx b/src/Time/TimeManager.hxx index c0a89c39a..53dffd51b 100644 --- a/src/Time/TimeManager.hxx +++ b/src/Time/TimeManager.hxx @@ -22,11 +22,12 @@ #define FG_TIME_TIMEMANAGER_HXX #include +#include // forward decls class SGTime; -class TimeManager : public SGSubsystem +class TimeManager : public SGSubsystem, public SGPropertyChangeListener { public: TimeManager(); @@ -36,10 +37,14 @@ public: virtual void init(); virtual void reinit(); virtual void postinit(); + virtual void shutdown(); void update(double dt); +// SGPropertyChangeListener overrides + virtual void valueChanged(SGPropertyNode *); private: + /** * Ensure a consistent update-rate using a combination of * sleep()-ing and busy-waiting. @@ -64,14 +69,20 @@ private: SGPropertyNode_ptr _maxDtPerFrame; SGPropertyNode_ptr _clockFreeze; SGPropertyNode_ptr _timeOverride; + SGPropertyNode_ptr _warp; + SGPropertyNode_ptr _warpDelta; + bool _lastClockFreeze; - + bool _adjustWarpOnUnfreeze; + SGPropertyNode_ptr _longitudeDeg; SGPropertyNode_ptr _latitudeDeg; -// frame-rate / update-rate counters + // frame-rate / worst-case latency / update-rate counters SGPropertyNode_ptr _frameRate; + SGPropertyNode_ptr _frameLatency; time_t _lastFrameTime; + double _frameLatencyMax; int _frameCount; };