diff options
author | Max Horn | 2010-11-28 14:57:59 +0000 |
---|---|---|
committer | Max Horn | 2010-11-28 14:57:59 +0000 |
commit | d5840b72f9535e303d340cb8f5f164ddb6fc27ee (patch) | |
tree | 70b002148eced2d94e20bdbe7926bde5817cd60d /backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp | |
parent | 0b5f6d4c979028b78c3b6c33f371b46b31cd0c9b (diff) | |
download | scummvm-rg350-d5840b72f9535e303d340cb8f5f164ddb6fc27ee.tar.gz scummvm-rg350-d5840b72f9535e303d340cb8f5f164ddb6fc27ee.tar.bz2 scummvm-rg350-d5840b72f9535e303d340cb8f5f164ddb6fc27ee.zip |
DINGUX: Attempt to fix the new code for this backend
It seems in the gsoc2010-opengl branch, the dingux port was not anymore
updated at some point, so some changes that were made in general did not
make it till here. This is my attempt to fix at least the most obvious
problems, but without being able to compile it, all these changes should
be very carefully reviewed.
svn-id: r54522
Diffstat (limited to 'backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp')
-rw-r--r-- | backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index c38d53e86b..f92f71b1c1 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -503,4 +503,32 @@ bool DINGUXSdlGraphicsManager::isOverlayVisible() { return _overlayVisible; } +void DINGUXSdlGraphicsManager::warpMouse(int x, int y) { + if (_mouseCurState.x != x || _mouseCurState.y != y) { + if (_videoMode.mode == GFX_HALF && !_overlayVisible) { + x = x / 2; + y = y / 2; + } + } + SdlGraphicsManager::warpMouse(x, y); +} + +void DINGUXSdlGraphicsManager::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); + } + g_system->getEventManager()->pushEvent(newEvent); + } +} + #endif |