aboutsummaryrefslogtreecommitdiff
path: root/backends/events/sdl
diff options
context:
space:
mode:
authorrsn88872017-03-01 09:55:20 -0600
committerrsn88872017-03-01 09:55:20 -0600
commit12e226922d3f62ab55bd921f712a0be8f04497c0 (patch)
tree88ffebc89991f7edc8b16cab21d35c9ad35d6591 /backends/events/sdl
parent7898c904ba978254b6c99124e5c83fa6b0d77d23 (diff)
downloadscummvm-rg350-12e226922d3f62ab55bd921f712a0be8f04497c0.tar.gz
scummvm-rg350-12e226922d3f62ab55bd921f712a0be8f04497c0.tar.bz2
scummvm-rg350-12e226922d3f62ab55bd921f712a0be8f04497c0.zip
SDL: Always use sub-pixel joystick pointer resolution
Diffstat (limited to 'backends/events/sdl')
-rw-r--r--backends/events/sdl/sdl-events.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 9a9d652dce..a1657468a8 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -177,10 +177,6 @@ void SdlEventSource::processMouseEvent(Common::Event &event, int x, int y) {
_graphicsManager->notifyMousePos(Common::Point(x, y));
_graphicsManager->transformMouseCoordinates(event.mouse);
}
-
- // Update the "keyboard mouse" coords
- _km.x = x * MULTIPLIER;
- _km.y = y * MULTIPLIER;
}
bool SdlEventSource::handleKbdMouse(Common::Event &event) {
@@ -311,14 +307,8 @@ bool SdlEventSource::handleKbdMouse(Common::Event &event) {
}
if (_km.x != oldKmX || _km.y != oldKmY) {
- // keep hi-res coordinates since
- // processMouseEvent will overwrite them with lo-res numbers
- oldKmX = _km.x;
- oldKmY = _km.y;
event.type = Common::EVENT_MOUSEMOVE;
processMouseEvent(event, _km.x / MULTIPLIER, _km.y / MULTIPLIER);
- _km.x = oldKmX;
- _km.y = oldKmY;
return true;
}
}
@@ -745,6 +735,9 @@ bool SdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) {
bool SdlEventSource::handleMouseMotion(SDL_Event &ev, Common::Event &event) {
event.type = Common::EVENT_MOUSEMOVE;
processMouseEvent(event, ev.motion.x, ev.motion.y);
+ // update KbdMouse
+ _km.x = ev.motion.x * MULTIPLIER;
+ _km.y = ev.motion.y * MULTIPLIER;
return true;
}
@@ -768,6 +761,9 @@ bool SdlEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event)
return false;
processMouseEvent(event, ev.button.x, ev.button.y);
+ // update KbdMouse
+ _km.x = ev.button.x * MULTIPLIER;
+ _km.y = ev.button.y * MULTIPLIER;
return true;
}
@@ -784,6 +780,9 @@ bool SdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) {
else
return false;
processMouseEvent(event, ev.button.x, ev.button.y);
+ // update KbdMouse
+ _km.x = ev.button.x * MULTIPLIER;
+ _km.y = ev.button.y * MULTIPLIER;
return true;
}