diff options
author | Alejandro Marzini | 2010-07-15 01:21:20 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-07-15 01:21:20 +0000 |
commit | f53028d4a2d53238fb92e56bea6c737c57ffb123 (patch) | |
tree | 84f473bce0f643519a0ef7985619c25f731d8421 /backends/graphics/linuxmotosdl | |
parent | 84ceae932852fe684ea553daee712b52da83add6 (diff) | |
download | scummvm-rg350-f53028d4a2d53238fb92e56bea6c737c57ffb123.tar.gz scummvm-rg350-f53028d4a2d53238fb92e56bea6c737c57ffb123.tar.bz2 scummvm-rg350-f53028d4a2d53238fb92e56bea6c737c57ffb123.zip |
Replaced the extra SDL functions added to GraphicsManager with an EventObserver in SdlGraphicsManager.
svn-id: r50900
Diffstat (limited to 'backends/graphics/linuxmotosdl')
-rw-r--r-- | backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp | 23 | ||||
-rw-r--r-- | backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h | 4 |
2 files changed, 17 insertions, 10 deletions
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp index 390b27e5a5..dbedb2e1a7 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp @@ -474,16 +474,21 @@ void LinuxmotoSdlGraphicsManager::warpMouse(int x, int y) { SdlGraphicsManager::warpMouse(x, y); } -void LinuxmotoSdlGraphicsManager::adjustMouseEvent(Common::Event &event) { - if (!_overlayVisible) { - if (_videoMode.mode == GFX_HALF) { - event.mouse.x *= 2; - event.mouse.y *= 2; +void LinuxmotoSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { + if (!event.synthetic) { + Common::Event newEvent(event); + newEvent.synthetic = true; + if (!_overlayVisible) { + if (_videoMode.mode == GFX_HALF) { + event.mouse.x *= 2; + event.mouse.y *= 2; + } + newEvent.mouse.x /= _videoMode.scaleFactor; + newEvent.mouse.y /= _videoMode.scaleFactor; + if (_videoMode.aspectRatioCorrection) + newEvent.mouse.y = aspect2Real(newEvent.mouse.y); } - event.mouse.x /= _videoMode.scaleFactor; - event.mouse.y /= _videoMode.scaleFactor; - if (_videoMode.aspectRatioCorrection) - event.mouse.y = aspect2Real(event.mouse.y); + g_system->getEventManager()->pushEvent(newEvent); } } diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h index ce24e23992..1b387ca189 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h @@ -42,7 +42,9 @@ public: virtual void showOverlay(); virtual void hideOverlay(); virtual void warpMouse(int x, int y); - virtual void adjustMouseEvent(Common::Event &event); + +protected: + virtual void adjustMouseEvent(const Common::Event &event); }; #endif |