From bbd8c302a3e624f23bb0dd2d81a7b32ecbe7435e Mon Sep 17 00:00:00 2001 From: Paweł Kołodziejski Date: Tue, 10 Nov 2009 19:15:30 +0000 Subject: fix warpMouse(), add missing setMousePos on cursor events svn-id: r45808 --- backends/platform/samsungtv/events.cpp | 4 ++++ backends/platform/samsungtv/graphics.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'backends/platform') diff --git a/backends/platform/samsungtv/events.cpp b/backends/platform/samsungtv/events.cpp index f477f9c4d2..385b16b6c9 100644 --- a/backends/platform/samsungtv/events.cpp +++ b/backends/platform/samsungtv/events.cpp @@ -124,24 +124,28 @@ bool OSystem_SDL_SamsungTV::remapKey(SDL_Event &ev, Common::Event &event) { _km.y_down_count = 1; event.type = Common::EVENT_MOUSEMOVE; fillMouseEvent(event, _km.x, _km.y); + setMousePos(event.mouse.x, event.mouse.y); return true; } else if (ev.key.keysym.sym == SDLK_DOWN) { _km.y_vel = 1; _km.y_down_count = 1; event.type = Common::EVENT_MOUSEMOVE; fillMouseEvent(event, _km.x, _km.y); + setMousePos(event.mouse.x, event.mouse.y); return true; } else if (ev.key.keysym.sym == SDLK_LEFT) { _km.x_vel = -1; _km.x_down_count = 1; event.type = Common::EVENT_MOUSEMOVE; fillMouseEvent(event, _km.x, _km.y); + setMousePos(event.mouse.x, event.mouse.y); return true; } else if (ev.key.keysym.sym == SDLK_RIGHT) { _km.x_vel = 1; _km.x_down_count = 1; event.type = Common::EVENT_MOUSEMOVE; fillMouseEvent(event, _km.x, _km.y); + setMousePos(event.mouse.x, event.mouse.y); return true; } else if (ev.key.keysym.sym == SDLK_z) { event.type = Common::EVENT_LBUTTONDOWN; diff --git a/backends/platform/samsungtv/graphics.cpp b/backends/platform/samsungtv/graphics.cpp index 88f4674c54..79267b8628 100644 --- a/backends/platform/samsungtv/graphics.cpp +++ b/backends/platform/samsungtv/graphics.cpp @@ -541,6 +541,11 @@ void OSystem_SDL_SamsungTV::setFullscreenMode(bool enable) { } } +void OSystem_SDL_SamsungTV::warpMouse(int x, int y) { + if (_mouseCurState.x != x || _mouseCurState.y != y) + setMousePos(x, y); +} + void OSystem_SDL_SamsungTV::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) { if (!format) _cursorFormat = Graphics::PixelFormat::createFormatCLUT8(); @@ -837,8 +842,4 @@ void OSystem_SDL_SamsungTV::drawMouse() { addDirtyRect(dst.x, dst.y, dst.w, dst.h, true); } -void OSystem_SDL_SamsungTV::warpMouse(int x, int y) { - setMousePos(x, y); -} - #endif -- cgit v1.2.3