aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorColin Snover2017-09-15 23:02:53 -0500
committerColin Snover2017-09-19 19:54:29 -0500
commit301d0403cb46cbb268c914c3fdcf070c31781e07 (patch)
treec6f97b6dc3adc3ecb6b5c579acbb75dab503fd5d /engines/sci/graphics
parent22d157cee7a75a0dbe9b849d58a55e186a5ddb86 (diff)
downloadscummvm-rg350-301d0403cb46cbb268c914c3fdcf070c31781e07.tar.gz
scummvm-rg350-301d0403cb46cbb268c914c3fdcf070c31781e07.tar.bz2
scummvm-rg350-301d0403cb46cbb268c914c3fdcf070c31781e07.zip
SCI32: Don't warp the mouse twice when its position has been restricted
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/cursor32.cpp10
-rw-r--r--engines/sci/graphics/cursor32.h2
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