diff options
Diffstat (limited to 'engines/kyra/timer.h')
-rw-r--r-- | engines/kyra/timer.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/kyra/timer.h b/engines/kyra/timer.h index 0991f0a1b1..f668a88015 100644 --- a/engines/kyra/timer.h +++ b/engines/kyra/timer.h @@ -49,9 +49,11 @@ struct TimerEntry { class TimerManager { public: - TimerManager(KyraEngine *vm, OSystem *sys) : _vm(vm), _system(sys), _timers(), _nextRun(0) {} + TimerManager(KyraEngine *vm, OSystem *sys) : _vm(vm), _system(sys), _timers(), _nextRun(0), _isPaused(0), _pauseStart(0) {} ~TimerManager() { reset(); } + void pause(bool pause); + void reset(); void addTimer(uint8 id, TimerFunc *func, int countdown, bool enabled); @@ -82,10 +84,21 @@ private: Common::List<TimerEntry> _timers; uint32 _nextRun; + uint _isPaused; + uint32 _pauseStart; + typedef Common::List<TimerEntry>::iterator Iterator; typedef Common::List<TimerEntry>::const_iterator CIterator; }; +class PauseTimer { +public: + PauseTimer(TimerManager &timer) : _timer(timer) { _timer.pause(true); } + ~PauseTimer() { _timer.pause(false); } +private: + TimerManager &_timer; +}; + } // end of namespace Kyra #endif |