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.
This commit is contained in:
Martin Kiewitz 2016-02-14 22:43:52 +01:00
parent dcbcbb2120
commit 7b75936f56
5 changed files with 48 additions and 0 deletions

View file

@ -2327,6 +2327,9 @@ int AgiEngine::runLogic(int16 logicNr) {
}
#endif
// Just a counter for every instruction, that got executed
_instructionCounter++;
_game.execStack.back().curIP = state->_curLogic->cIP;
char st[101];