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.
This commit is contained in:
parent
fa4d310fb4
commit
0a8049e30c
2 changed files with 4 additions and 3 deletions
|
@ -287,8 +287,8 @@ void SdlEventSource::updateKbdMouse() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SdlEventSource::handleKbdMouse(Common::Event &event) {
|
bool SdlEventSource::handleKbdMouse(Common::Event &event) {
|
||||||
int16 oldKmX = _km.x;
|
int32 oldKmX = _km.x;
|
||||||
int16 oldKmY = _km.y;
|
int32 oldKmY = _km.y;
|
||||||
|
|
||||||
updateKbdMouse();
|
updateKbdMouse();
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,8 @@ protected:
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
struct KbdMouse {
|
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;
|
uint32 last_time, delay_time, x_down_time, y_down_time;
|
||||||
bool modifier;
|
bool modifier;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue