X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FTime%2FTimeManager.hxx;h=ef86c907f94fc9761fdb8bb240ea85c692845016;hb=da73dd97d3d0e36b6078728ac39f0b98cae46ff7;hp=c0a89c39a036d548ae3bf677ab54dea0acaa40c9;hpb=0bce31ae9a80c571b9126427c093b8dc3d3f6820;p=flightgear.git diff --git a/src/Time/TimeManager.hxx b/src/Time/TimeManager.hxx index c0a89c39a..ef86c907f 100644 --- a/src/Time/TimeManager.hxx +++ b/src/Time/TimeManager.hxx @@ -22,11 +22,13 @@ #define FG_TIME_TIMEMANAGER_HXX #include +#include +#include // forward decls class SGTime; -class TimeManager : public SGSubsystem +class TimeManager : public SGSubsystem, public SGPropertyChangeListener { public: TimeManager(); @@ -36,10 +38,16 @@ public: virtual void init(); virtual void reinit(); virtual void postinit(); + virtual void shutdown(); void update(double dt); +// SGPropertyChangeListener overrides + virtual void valueChanged(SGPropertyNode *); + + void setTimeOffset(const std::string& offset_type, long int offset); private: + /** * Ensure a consistent update-rate using a combination of * sleep()-ing and busy-waiting. @@ -64,15 +72,27 @@ 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 _frameRateWorst; + SGPropertyNode_ptr _frameLatency; time_t _lastFrameTime; + double _frameLatencyMax; int _frameCount; + + SGPropObjBool _sceneryLoaded, + _sceneryLoadOverride; + SGPropObjInt _modelHz; + SGPropObjDouble _timeDelta, _simTimeDelta; }; #endif // of FG_TIME_TIMEMANAGER_HXX