From 84e6e1b8c506970ff7351515057e30313b013b43 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 6 Nov 2019 22:04:47 +0100 Subject: GRIFFON: Fix sluggishness in the inventory menu --- engines/griffon/engine.cpp | 1 - engines/griffon/input.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/griffon/engine.cpp b/engines/griffon/engine.cpp index 291076cdaa..5c0a28d791 100644 --- a/engines/griffon/engine.cpp +++ b/engines/griffon/engine.cpp @@ -80,7 +80,6 @@ void GriffonEngine::mainLoop() { void GriffonEngine::updateEngine() { g_system->updateScreen(); - g_system->getEventManager()->pollEvent(_event); _ticksPassed = _ticks; _ticks = g_system->getMillis(); diff --git a/engines/griffon/input.cpp b/engines/griffon/input.cpp index 4b2ea5cff4..cc6a48dee7 100644 --- a/engines/griffon/input.cpp +++ b/engines/griffon/input.cpp @@ -43,8 +43,10 @@ namespace Griffon { void GriffonEngine::checkInputs() { int ntickdelay = 175; + bool _keyPressed = false; - g_system->getEventManager()->pollEvent(_event); + if (g_system->getEventManager()->pollEvent(_event)) + _keyPressed = true; _postInfoNbr = 0; @@ -307,7 +309,7 @@ __exit_do: _curEnemy = _lastNpc + _postInfoNbr; } } else { - if (_itemTicks < _ticks) { + if (_keyPressed && _event.type == Common::EVENT_KEYDOWN) { if (_event.kbd.keycode == Common::KEYCODE_UP) { _curItem = _curItem - 1; _itemTicks = _ticks + ntickdelay; -- cgit v1.2.3