[Scummvm-git-logs] scummvm master -> 5e723aa971806d84ba99bfe4d594c3b0a5a6f55b

aquadran noreply at scummvm.org
Sun Jan 16 20:42:19 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5e723aa971 GRIM: Improve GrimEngine::clearEventQueue() handling


Commit: 5e723aa971806d84ba99bfe4d594c3b0a5a6f55b
    https://github.com/scummvm/scummvm/commit/5e723aa971806d84ba99bfe4d594c3b0a5a6f55b
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2022-01-16T21:42:13+01:00

Commit Message:
GRIM: Improve GrimEngine::clearEventQueue() handling

Changed paths:
    engines/grim/grim.cpp
    engines/grim/lua_v1.cpp


diff --git a/engines/grim/grim.cpp b/engines/grim/grim.cpp
index 7ba28635fc5..2debac53bee 100644
--- a/engines/grim/grim.cpp
+++ b/engines/grim/grim.cpp
@@ -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;
diff --git a/engines/grim/lua_v1.cpp b/engines/grim/lua_v1.cpp
index 18dc1b260b2..c302f31e6e0 100644
--- a/engines/grim/lua_v1.cpp
+++ b/engines/grim/lua_v1.cpp
@@ -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() {




More information about the Scummvm-git-logs mailing list