diff options
author | Johannes Schickel | 2011-08-08 23:46:05 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-08-09 00:03:11 +0200 |
commit | 0630a88a04e9688d664751b6a68edf622d76b348 (patch) | |
tree | 87d7867c298c60272eff69777b16bff5c15c8bfe /backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp | |
parent | dedc74abfa44f7dac344da1868588193f91dd4f1 (diff) | |
download | scummvm-rg350-0630a88a04e9688d664751b6a68edf622d76b348.tar.gz scummvm-rg350-0630a88a04e9688d664751b6a68edf622d76b348.tar.bz2 scummvm-rg350-0630a88a04e9688d664751b6a68edf622d76b348.zip |
SDL: Let SDL based graphics managers inherit from SdlGraphicsManager.
This also adapts port I can not test (not even the compilation). So if this
breaks anything I am sorry about it.
Diffstat (limited to 'backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp')
-rw-r--r-- | backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index 8075d0d45b..5aa39aa9a5 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -514,17 +514,22 @@ void DINGUXSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) { if (!event.synthetic) { Common::Event newEvent(event); newEvent.synthetic = true; - if (!_overlayVisible) { - if (_videoMode.mode == GFX_HALF) { - newEvent.mouse.x *= 2; - newEvent.mouse.y *= 2; - } - newEvent.mouse.x /= _videoMode.scaleFactor; - newEvent.mouse.y /= _videoMode.scaleFactor; - if (_videoMode.aspectRatioCorrection) - newEvent.mouse.y = aspect2Real(newEvent.mouse.y); + transformMouseCoordinates(newEvent.mouse); + g_system->getEventManager()->pushEvent(newEvent); + } +} + +void DINGUXSdlGraphicsManager::transformMouseCoordinates(Common::Point &point) { + if (!_overlayVisible) { + if (_videoMode.mode == GFX_HALF) { + point.x *= 2; + point.y *= 2; } g_system->getEventManager()->pushEvent(newEvent); + point.x /= _videoMode.scaleFactor; + point.y /= _videoMode.scaleFactor; + if (_videoMode.aspectRatioCorrection) + point.y = aspect2Real(point.y); } } |