diff options
author | Colin Snover | 2016-10-14 19:35:07 -0500 |
---|---|---|
committer | Colin Snover | 2016-10-14 19:52:21 -0500 |
commit | 630346855535d32c7686aae83f9612f5ae39c4da (patch) | |
tree | 04f7f5eb84e7de6e4d9d4e6b7f2eb1ef7211863f /engines | |
parent | c3adfc065ea925fc6f7e0dccd8352f3d2c64e98a (diff) | |
download | scummvm-rg350-630346855535d32c7686aae83f9612f5ae39c4da.tar.gz scummvm-rg350-630346855535d32c7686aae83f9612f5ae39c4da.tar.bz2 scummvm-rg350-630346855535d32c7686aae83f9612f5ae39c4da.zip |
SCI32: Fix mouse position clamping
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/event.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index 44ac7ef4cf..e365296914 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -173,20 +173,18 @@ SciEvent EventManager::getScummVMEvent() { if (getSciVersion() >= SCI_VERSION_2) { const Buffer &screen = g_sci->_gfxFrameout->getCurrentBuffer(); + // This will clamp `mousePos` according to the restricted zone, + // so any cursor or screen item associated with the mouse position + // does not bounce when it hits the edge (or ignore the edge) + g_sci->_gfxCursor32->deviceMoved(mousePos); + Common::Point mousePosSci = mousePos; mulru(mousePosSci, Ratio(screen.scriptWidth, screen.screenWidth), Ratio(screen.scriptHeight, screen.screenHeight)); noEvent.mousePosSci = input.mousePosSci = mousePosSci; - if (ev.type == Common::EVENT_MOUSEMOVE) { - // This will clamp `mousePos` according to the restricted zone, - // so any cursor or screen item associated with the mouse position - // does not bounce when it hits the edge (or ignore the edge) - g_sci->_gfxCursor32->deviceMoved(mousePos); - if (_hotRectanglesActive) { - checkHotRectangles(mousePosSci); - } + if (_hotRectanglesActive) { + checkHotRectangles(mousePosSci); } - } else { #endif g_sci->_gfxScreen->adjustBackUpscaledCoordinates(mousePos.y, mousePos.x); |