diff options
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/cursor32.cpp | 10 | ||||
-rw-r--r-- | engines/sci/graphics/cursor32.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/engines/sci/graphics/cursor32.cpp b/engines/sci/graphics/cursor32.cpp index 9bb0d4a112..6eb708531f 100644 --- a/engines/sci/graphics/cursor32.cpp +++ b/engines/sci/graphics/cursor32.cpp @@ -340,9 +340,9 @@ 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); + if (!deviceMoved(newPosition)) { + g_system->warpMouse(newPosition.x, newPosition.y); + } } void GfxCursor32::gonnaPaint(Common::Rect paintRect) { @@ -375,7 +375,7 @@ void GfxCursor32::donePainting() { } } -void GfxCursor32::deviceMoved(Common::Point &position) { +bool GfxCursor32::deviceMoved(Common::Point &position) { bool restricted = false; if (position.x < _restrictedArea.left) { @@ -403,6 +403,8 @@ void GfxCursor32::deviceMoved(Common::Point &position) { _position = position; move(); } + + return restricted; } void GfxCursor32::move() { diff --git a/engines/sci/graphics/cursor32.h b/engines/sci/graphics/cursor32.h index 00a8b9baa4..5872744aec 100644 --- a/engines/sci/graphics/cursor32.h +++ b/engines/sci/graphics/cursor32.h @@ -46,7 +46,7 @@ public: /** * Called when the hardware mouse moves. */ - void deviceMoved(Common::Point &position); + bool deviceMoved(Common::Point &position); /** * Called by GfxFrameout once for each show |