diff options
author | Nipun Garg | 2019-06-21 09:35:23 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:54 +0200 |
commit | b913a3632d80dfed276c325de8cae622f35873ff (patch) | |
tree | 44846c2f7b984ba5b2e7c3442c5a4e2d1cca0fa4 | |
parent | aec87e7058c788e7d37d1e639056d616b1ff56e2 (diff) | |
download | scummvm-rg350-b913a3632d80dfed276c325de8cae622f35873ff.tar.gz scummvm-rg350-b913a3632d80dfed276c325de8cae622f35873ff.tar.bz2 scummvm-rg350-b913a3632d80dfed276c325de8cae622f35873ff.zip |
HDB: Add time-keeping functions
-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 |