diff options
author | Johannes Schickel | 2015-01-24 23:42:12 +0100 |
---|---|---|
committer | Johannes Schickel | 2015-01-25 18:57:38 +0100 |
commit | 3a2db0135d93b5f12fd42f04db3b6ad9d40834d3 (patch) | |
tree | 5b021b6b70148fb60bcaa08be7f68b427b730d09 /backends/events | |
parent | 4e1ffc9434f771d3f43e66104adeea9e0166123c (diff) | |
download | scummvm-rg350-3a2db0135d93b5f12fd42f04db3b6ad9d40834d3.tar.gz scummvm-rg350-3a2db0135d93b5f12fd42f04db3b6ad9d40834d3.tar.bz2 scummvm-rg350-3a2db0135d93b5f12fd42f04db3b6ad9d40834d3.zip |
SDL: Refactor WM specific functionality into SdlGraphicsManager.
Diffstat (limited to 'backends/events')
-rw-r--r-- | backends/events/sdl/sdl-events.cpp | 15 | ||||
-rw-r--r-- | backends/events/sdl/sdl-events.h | 5 | ||||
-rw-r--r-- | backends/events/symbiansdl/symbiansdl-events.cpp | 4 |
3 files changed, 9 insertions, 15 deletions
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp index 284e0970fd..d6d0731202 100644 --- a/backends/events/sdl/sdl-events.cpp +++ b/backends/events/sdl/sdl-events.cpp @@ -173,7 +173,9 @@ void SdlEventSource::handleKbdMouse() { _km.y_down_count = 1; } - SDL_WarpMouse((Uint16)_km.x, (Uint16)_km.y); + if (_graphicsManager) { + _graphicsManager->warpMouseInWindow((Uint16)_km.x, (Uint16)_km.y); + } } } } @@ -429,7 +431,9 @@ bool SdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) { // Ctrl-m toggles mouse capture if (event.kbd.hasFlags(Common::KBD_CTRL) && ev.key.keysym.sym == 'm') { - toggleMouseGrab(); + if (_graphicsManager) { + _graphicsManager->toggleMouseGrab(); + } return false; } @@ -752,13 +756,6 @@ bool SdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { return false; } -void SdlEventSource::toggleMouseGrab() { - if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_OFF) - SDL_WM_GrabInput(SDL_GRAB_ON); - else - SDL_WM_GrabInput(SDL_GRAB_OFF); -} - void SdlEventSource::resetKeyboadEmulation(int16 x_max, int16 y_max) { _km.x_max = x_max; _km.y_max = y_max; diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h index a1b6d5ec3c..7001e41db1 100644 --- a/backends/events/sdl/sdl-events.h +++ b/backends/events/sdl/sdl-events.h @@ -49,11 +49,6 @@ public: */ virtual void resetKeyboadEmulation(int16 x_max, int16 y_max); - /** - * Toggles mouse input grab - */ - virtual void toggleMouseGrab(); - protected: /** @name Keyboard mouse emulation * Disabled by fingolfin 2004-12-18. diff --git a/backends/events/symbiansdl/symbiansdl-events.cpp b/backends/events/symbiansdl/symbiansdl-events.cpp index 36018f1024..97361e3df0 100644 --- a/backends/events/symbiansdl/symbiansdl-events.cpp +++ b/backends/events/symbiansdl/symbiansdl-events.cpp @@ -133,7 +133,9 @@ bool SymbianSdlEventSource::remapKey(SDL_Event &ev, Common::Event &event) { _currentZone = 0; event.type = Common::EVENT_MOUSEMOVE; processMouseEvent(event, _mouseXZone[_currentZone], _mouseYZone[_currentZone]); - SDL_WarpMouse(event.mouse.x, event.mouse.y); + if (_graphicsManager) { + _graphicsManager->warpMouseInWindow(event.mouse.x, event.mouse.y); + } } return true; |