diff options
| author | Johannes Schickel | 2008-04-28 19:51:34 +0000 |
|---|---|---|
| committer | Johannes Schickel | 2008-04-28 19:51:34 +0000 |
| commit | 7577e7548c50fac70090078266091caa2f1e0f4b (patch) | |
| tree | a78acd4a19637724b8b7313ead8816b2e296a955 /engines | |
| parent | d02503761c4fdcad702e11b50e404eaf7a26b122 (diff) | |
| download | scummvm-rg350-7577e7548c50fac70090078266091caa2f1e0f4b.tar.gz scummvm-rg350-7577e7548c50fac70090078266091caa2f1e0f4b.tar.bz2 scummvm-rg350-7577e7548c50fac70090078266091caa2f1e0f4b.zip | |
Fixed bug in TimerManager::update, this should fix tic-tac-toe game in kyra3.
svn-id: r31763
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/kyra/kyra_v3.cpp | 1 | ||||
| -rw-r--r-- | engines/kyra/timer.cpp | 18 | ||||
| -rw-r--r-- | engines/kyra/timer_v3.cpp | 1 |
3 files changed, 13 insertions, 7 deletions
diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_v3.cpp index 1d38981db3..d6f68daf4f 100644 --- a/engines/kyra/kyra_v3.cpp +++ b/engines/kyra/kyra_v3.cpp @@ -1173,7 +1173,6 @@ void KyraEngine_v3::updateWithText() { //XXX updateSpecialSceneScripts(); updateCommandLine(); - //XXX musicUpdate(0); restorePage3(); diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp index f275867516..1f25f88c97 100644 --- a/engines/kyra/timer.cpp +++ b/engines/kyra/timer.cpp @@ -99,17 +99,23 @@ void TimerManager::update() { _nextRun += 99999; for (Iterator pos = _timers.begin(); pos != _timers.end(); ++pos) { - if (pos->enabled && pos->countdown >= 0 && pos->nextRun <= _system->getMillis()) { - if (pos->func && pos->func->isValid()) - (*pos->func)(pos->id); + if (pos->enabled) - uint32 curTime = _system->getMillis(); - pos->lastUpdate = curTime; - pos->nextRun = curTime + pos->countdown * _vm->tickLength(); + if (pos->enabled && pos->countdown >= 0) { + if (pos->nextRun <= _system->getMillis()) { + if (pos->func && pos->func->isValid()) { + (*pos->func)(pos->id); + } + + uint32 curTime = _system->getMillis(); + pos->lastUpdate = curTime; + pos->nextRun = curTime + pos->countdown * _vm->tickLength(); + } _nextRun = MIN(_nextRun, pos->nextRun); } } + } void TimerManager::resync() { diff --git a/engines/kyra/timer_v3.cpp b/engines/kyra/timer_v3.cpp index 4ce73ceaec..5f93a00c8a 100644 --- a/engines/kyra/timer_v3.cpp +++ b/engines/kyra/timer_v3.cpp @@ -51,6 +51,7 @@ void KyraEngine_v3::timerRestoreCommandLine(int arg) { void KyraEngine_v3::timerRunSceneScript7(int arg) { debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v3::timerRunSceneScript7(%d)", arg); + _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData); _sceneScriptState.regs[1] = _mouseX; _sceneScriptState.regs[2] = _mouseY; _sceneScriptState.regs[3] = 0; |
