GRIM: Improve GrimEngine::clearEventQueue() handling

This commit is contained in:
Paweł Kołodziejski 2022-01-16 21:42:13 +01:00
parent 25f31a4989
commit 5e723aa971
No known key found for this signature in database
GPG Key ID: 0BDADC9E74440FF7
2 changed files with 3 additions and 5 deletions

View File

@ -1619,9 +1619,8 @@ void GrimEngine::setMode(EngineMode mode) {
}
void GrimEngine::clearEventQueue() {
Common::Event event;
while (g_system->getEventManager()->pollEvent(event)) {
}
g_system->getEventManager()->purgeKeyboardEvents();
g_system->getEventManager()->purgeMouseEvents();
for (int i = 0; i < KEYCODE_EXTRA_LAST; ++i) {
_controlsState[i] = false;

View File

@ -711,8 +711,7 @@ void Lua_V1::EnableDebugKeys() {
}
void Lua_V1::FlushControls() {
g_system->getEventManager()->purgeKeyboardEvents();
g_system->getEventManager()->purgeMouseEvents();
g_grim->clearEventQueue();
}
void Lua_V1::LightMgrSetChange() {