diff options
author | Colin Snover | 2017-09-15 13:53:00 -0500 |
---|---|---|
committer | Colin Snover | 2017-09-19 19:54:29 -0500 |
commit | 22d157cee7a75a0dbe9b849d58a55e186a5ddb86 (patch) | |
tree | 884d93291e0c60e6897892a44f513149f400340e | |
parent | d36d01b82cdf88e40c62851170f06e526d36f352 (diff) | |
download | scummvm-rg350-22d157cee7a75a0dbe9b849d58a55e186a5ddb86.tar.gz scummvm-rg350-22d157cee7a75a0dbe9b849d58a55e186a5ddb86.tar.bz2 scummvm-rg350-22d157cee7a75a0dbe9b849d58a55e186a5ddb86.zip |
SCI32: Flush all events before warping mouse
This improves the behaviour at the end of PQ4 when navigating the
warehouse with the flashlight by getting rid of mouse events that
may have been queued before the mouse warp to the other side of
the screen is performed. Without this, frequently, those extra
events would then be processed and cause the mouse to jump back to
the opposite side of the screen, triggering another navigation in
the opposite direction.
This patch really only helps when mouse capture is enabled in
ScummVM as well, but it does allow the sequence to be played
pretty much normally in that situation. Additional (pending)
patches to ScummVM itself are needed to move the mouse to the
correct place when mouse capture is off and the system mouse moves
outside of the game window.
Refs Trac#9689.
-rw-r--r-- | engines/sci/graphics/cursor32.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/engines/sci/graphics/cursor32.cpp b/engines/sci/graphics/cursor32.cpp index 1db74024b7..9bb0d4a112 100644 --- a/engines/sci/graphics/cursor32.cpp +++ b/engines/sci/graphics/cursor32.cpp @@ -340,6 +340,7 @@ void GfxCursor32::setPosition(const Common::Point &position) { newPosition.x = (position.x * Ratio(screenWidth, scriptWidth)).toInt(); newPosition.y = (position.y * Ratio(screenHeight, scriptHeight)).toInt(); + g_sci->getEventManager()->flushEvents(); g_system->warpMouse(newPosition.x, newPosition.y); deviceMoved(newPosition); } |