diff options
author | Martin Kiewitz | 2016-02-14 22:43:52 +0100 |
---|---|---|
committer | Martin Kiewitz | 2016-02-14 22:43:52 +0100 |
commit | 7b75936f56fc5ea089e3fc957a113dc7577e832f (patch) | |
tree | 326117295350ac0b7b1807893969e2224a51e1df /engines/agi/cycle.cpp | |
parent | dcbcbb2120de788207340e0b1bffae70397e1161 (diff) | |
download | scummvm-rg350-7b75936f56fc5ea089e3fc957a113dc7577e832f.tar.gz scummvm-rg350-7b75936f56fc5ea089e3fc957a113dc7577e832f.tar.bz2 scummvm-rg350-7b75936f56fc5ea089e3fc957a113dc7577e832f.zip |
AGI: Add heuristic to detect delay loops within scripts
And in that case poll events, delay for a few milliseconds and
update screen.
This somewhat worked before the graphics rewrite because of
a timer hack.
This one tries to detect actual inner loops.
Happens in at least Police Quest 1 when playing poker.
Diffstat (limited to 'engines/agi/cycle.cpp')
-rw-r--r-- | engines/agi/cycle.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index a3873a0184..9b7dc63df8 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -142,6 +142,9 @@ void AgiEngine::interpretCycle() { oldScore = getVar(VM_VAR_SCORE); oldSound = getFlag(VM_FLAG_SOUND_ON); + // Reset script heuristic here + resetGetVarSecondsHeuristic(); + _game.exitAllLogics = false; while (runLogic(0) == 0 && !(shouldQuit() || _restartGame)) { setVar(VM_VAR_WORD_NOT_FOUND, 0); |