diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/agi.h | 2 | ||||
-rw-r--r-- | engines/agi/cycle.cpp | 33 | ||||
-rw-r--r-- | engines/agi/op_test.cpp | 7 |
3 files changed, 26 insertions, 16 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h index 520b0aae59..93a456b9a6 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -942,7 +942,7 @@ public: void setvar(int, int); void decrypt(uint8 *mem, int len); void releaseSprites(); - int mainCycle(); + int mainCycle(bool onlyCheckForEvents = false); int viewPictures(); int runGame(); void inventory(); diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index 86f0b9e9db..702ca907d7 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -187,12 +187,14 @@ void AgiEngine::oldInputMode() { } // If main_cycle returns false, don't process more events! -int AgiEngine::mainCycle() { +int AgiEngine::mainCycle(bool onlyCheckForEvents) { unsigned int key, kascii; VtEntry *v = &_game.viewTable[0]; - pollTimer(); - updateTimer(); + if (!onlyCheckForEvents) { + pollTimer(); + updateTimer(); + } key = doPollKeyboard(); @@ -205,7 +207,13 @@ int AgiEngine::mainCycle() { _game.vars[29] = _mouse.y; //} - if (key == KEY_PRIORITY) { + if (key == KEY_STATUSLN) { // F11 + _debug.statusline = !_debug.statusline; + writeStatus(); + key = 0; + } + + if (key == KEY_PRIORITY) { // F12 _sprites->eraseBoth(); _debug.priority = !_debug.priority; _picture->showPic(); @@ -214,14 +222,8 @@ int AgiEngine::mainCycle() { key = 0; } - if (key == KEY_STATUSLN) { - _debug.statusline = !_debug.statusline; - writeStatus(); - key = 0; - } - // Click-to-walk mouse interface - if (_game.playerControl && v->flags & fAdjEgoXY) { + if (_game.playerControl && (v->flags & fAdjEgoXY)) { int toX = v->parm1; int toY = v->parm2; @@ -289,10 +291,13 @@ int AgiEngine::mainCycle() { break; } } while (restartProcessKey); - _gfx->doUpdate(); - if (_game.msgBoxTicks > 0) - _game.msgBoxTicks--; + if (!onlyCheckForEvents) { + _gfx->doUpdate(); + + if (_game.msgBoxTicks > 0) + _game.msgBoxTicks--; + } return true; } diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp index 124a1cfcb7..18861a2190 100644 --- a/engines/agi/op_test.cpp +++ b/engines/agi/op_test.cpp @@ -259,7 +259,12 @@ uint8 AgiEngine::testKeypressed() { InputMode mode = _game.inputMode; _game.inputMode = INPUT_NONE; - mainCycle(); + // Only check for events here, without updating the game cycle, + // otherwise the animations in some games are drawn too quickly + // like, for example, Manannan's lightnings in the intro of KQ3 + // and the bullets opened in the logo of PQ1, during its intro. + // Fixes bug #3600733 + mainCycle(true); _game.inputMode = mode; } |