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 .
This commit is contained in:
Bastien Bouclet 2019-06-27 20:03:24 +02:00
parent fa4d310fb4
commit 0a8049e30c
2 changed files with 4 additions and 3 deletions
backends/events/sdl

@ -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();

@ -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;
};