diff options
author | Eugene Sandulenko | 2017-03-04 11:50:12 +0100 |
---|---|---|
committer | GitHub | 2017-03-04 11:50:12 +0100 |
commit | 9fcb56f24c335be77a7391bdada32ab7a6b2eb58 (patch) | |
tree | e1e02887d43f7bde98f28193e4a0db75a0f69449 /backends/events/sdl/sdl-events.cpp | |
parent | 07625ba8234fa2fc53a1c010beee8ba6f5f4ebec (diff) | |
parent | 12e226922d3f62ab55bd921f712a0be8f04497c0 (diff) | |
download | scummvm-rg350-9fcb56f24c335be77a7391bdada32ab7a6b2eb58.tar.gz scummvm-rg350-9fcb56f24c335be77a7391bdada32ab7a6b2eb58.tar.bz2 scummvm-rg350-9fcb56f24c335be77a7391bdada32ab7a6b2eb58.zip |
Merge pull request #914 from rsn8887/upstream
SDL: Always use sub-pixel joystick pointer
Diffstat (limited to 'backends/events/sdl/sdl-events.cpp')
-rw-r--r-- | backends/events/sdl/sdl-events.cpp | 19 |
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; } |