diff options
author | athrxx | 2020-01-08 19:36:31 +0100 |
---|---|---|
committer | athrxx | 2020-01-08 20:27:54 +0100 |
commit | 24d0159e799d82b6305fc4dd968faf8e9c3b3c9a (patch) | |
tree | f7a1b17610504b897f1fa32c0ca0dacb8b165a5f /engines/kyra/engine | |
parent | ec872b8dc8fffc631b9b5e84c701800a20d02220 (diff) | |
download | scummvm-rg350-24d0159e799d82b6305fc4dd968faf8e9c3b3c9a.tar.gz scummvm-rg350-24d0159e799d82b6305fc4dd968faf8e9c3b3c9a.tar.bz2 scummvm-rg350-24d0159e799d82b6305fc4dd968faf8e9c3b3c9a.zip |
KYRA: (LOK) - fix mouse cursor bug (see #11303)
Diffstat (limited to 'engines/kyra/engine')
-rw-r--r-- | engines/kyra/engine/kyra_v1.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/engines/kyra/engine/kyra_v1.cpp b/engines/kyra/engine/kyra_v1.cpp index fc43919b57..c708756b19 100644 --- a/engines/kyra/engine/kyra_v1.cpp +++ b/engines/kyra/engine/kyra_v1.cpp @@ -235,6 +235,19 @@ void KyraEngine_v1::setMousePos(int x, int y) { y <<= 1; } _system->warpMouse(x, y); + + // Feed the event manager an artficial mouse move event, since warpMouse() won't generate one. + // From the warpMouse comments I gather that this behavior is intentional due to requirements of + // the SCUMM engine. In KYRA we need to get the same coordinates from _eventMan->getMousePos() + // that we send via warpMouse(). We have script situations in Kyra (like the Alchemists' crystals + // scene) where a new mouse cursor position is set and then immediately read. This function would + // then get wrong coordinates. + Common::Event event; + event.type = Common::EVENT_MOUSEMOVE; + event.mouse.x = x; + event.mouse.y = y; + _eventMan->pushEvent(event); + updateInput(); } int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) { |