aboutsummaryrefslogtreecommitdiff
path: root/backends/events
diff options
context:
space:
mode:
authorBastien Bouclet2019-06-27 20:03:24 +0200
committerBastien Bouclet2019-06-27 20:12:52 +0200
commit0a8049e30c97acac5ae5f55a722173dfbc20cd25 (patch)
treeb1e55aba159f5e99d314d4ce0a9abc62d1161951 /backends/events
parentfa4d310fb4d3ccdcf45b2f78e2a23126ec07f006 (diff)
downloadscummvm-rg350-0a8049e30c97acac5ae5f55a722173dfbc20cd25.tar.gz
scummvm-rg350-0a8049e30c97acac5ae5f55a722173dfbc20cd25.tar.bz2
scummvm-rg350-0a8049e30c97acac5ae5f55a722173dfbc20cd25.zip
SDL: Fix gamepad mouse cursor wrapping on hi-res screens
The cursor position was overflowing a signed 16-bits integer once multiplied with MULTIPLIER when using a resolution such as 2560x1440. It would be nice changing this code to make more sense, sadly it is thightly coupled with platform specific subclasses. Fixes #10996.
Diffstat (limited to 'backends/events')
-rw-r--r--backends/events/sdl/sdl-events.cpp4
-rw-r--r--backends/events/sdl/sdl-events.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 50235171f5..29be7d4e74 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -287,8 +287,8 @@ void SdlEventSource::updateKbdMouse() {
}
bool SdlEventSource::handleKbdMouse(Common::Event &event) {
- int16 oldKmX = _km.x;
- int16 oldKmY = _km.y;
+ int32 oldKmX = _km.x;
+ int32 oldKmY = _km.y;
updateKbdMouse();
diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h
index 8ee51147a4..c2ae0023ce 100644
--- a/backends/events/sdl/sdl-events.h
+++ b/backends/events/sdl/sdl-events.h
@@ -66,7 +66,8 @@ protected:
//@{
struct KbdMouse {
- int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count, joy_x, joy_y;
+ int32 x, y;
+ int16 x_vel, y_vel, x_max, y_max, x_down_count, y_down_count, joy_x, joy_y;
uint32 last_time, delay_time, x_down_time, y_down_time;
bool modifier;
};