diff options
author | Willem Jan Palenstijn | 2013-04-18 23:35:23 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:40:58 +0200 |
commit | 9c2341678ef4984bf92b3878295250faf980b066 (patch) | |
tree | 2fb4805e05e16b9924e80c9947e6bad723b28c4b /engines/kyra/timer.cpp | |
parent | 8172d679df5148a4a32f46074b20cb6caf91844f (diff) | |
parent | a5f4ff36ffc386d48f2da49387a9655ce9295a4d (diff) | |
download | scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.gz scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.tar.bz2 scummvm-rg350-9c2341678ef4984bf92b3878295250faf980b066.zip |
Merge branch 'master'
Diffstat (limited to 'engines/kyra/timer.cpp')
-rw-r--r-- | engines/kyra/timer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp index 9834646a45..95c283f063 100644 --- a/engines/kyra/timer.cpp +++ b/engines/kyra/timer.cpp @@ -149,6 +149,8 @@ void TimerManager::setCountdown(uint8 id, int32 countdown) { uint32 curTime = _system->getMillis(); timer->lastUpdate = curTime; timer->nextRun = curTime + countdown * _vm->tickLength(); + if (timer->enabled & 2) + timer->pauseStartTime = curTime; _nextRun = MIN(_nextRun, timer->nextRun); } @@ -177,6 +179,8 @@ int32 TimerManager::getDelay(uint8 id) const { void TimerManager::setNextRun(uint8 id, uint32 nextRun) { Iterator timer = Common::find_if(_timers.begin(), _timers.end(), TimerEqual(id)); if (timer != _timers.end()) { + if (timer->enabled & 2) + timer->pauseStartTime = _system->getMillis(); timer->nextRun = nextRun; return; } @@ -217,7 +221,7 @@ void TimerManager::pauseSingleTimer(uint8 id, bool p) { bool TimerManager::isEnabled(uint8 id) const { CIterator timer = Common::find_if(_timers.begin(), _timers.end(), TimerEqual(id)); if (timer != _timers.end()) - return (timer->enabled == 1); + return (timer->enabled & 1); warning("TimerManager::isEnabled: No timer %d", id); return false; |