diff options
Diffstat (limited to 'engines/hdb')
-rw-r--r-- | engines/hdb/hdb.cpp | 5 | ||||
-rw-r--r-- | engines/hdb/hdb.h | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index 018e1e51dd..bea2c7ec7d 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -288,6 +288,11 @@ Common::Error HDBGame::run() { _drawMan->drawSky(); _map->draw(); _ai->processCines(); + + // Update Timer that's NOT used for in-game Timing + _prevTimeSlice = _timeSlice; + _timeSlice = g_system->getMillis(); + paint(); g_system->updateScreen(); diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h index ede41bae9e..b748101894 100644 --- a/engines/hdb/hdb.h +++ b/engines/hdb/hdb.h @@ -134,10 +134,31 @@ public: _actionMode = status; } + void resetTimer() { + _timePlayed = _timeSeconds = 0; + } + + uint16 getTime() { + return _timePlayed / 1000; + } + + uint16 getTimeSlice() { + return _timeSlice; + } + + uint16 getTimeSliceDelta() { + return _timeSlice - _prevTimeSlice; + } + bool _gameShutdown; Graphics::PixelFormat _format; private: + + uint32 _timePlayed; + uint32 _timeSlice, _prevTimeSlice; + uint32 _timeSeconds; + Console *_console; // Game Variables |