diff options
Diffstat (limited to 'backends/graphics')
-rw-r--r-- | backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp | 28 | ||||
-rw-r--r-- | backends/graphics/dinguxsdl/dinguxsdl-graphics.h | 4 |
2 files changed, 31 insertions, 1 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 diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h index b2edd73f6d..9668f45166 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h @@ -56,10 +56,12 @@ public: bool loadGFXMode(); void drawMouse(); void undrawMouse(); + virtual void warpMouse(int x, int y); SdlGraphicsManager::MousePos *getMouseCurState(); SdlGraphicsManager::VideoState *getVideoMode(); - bool isOverlayVisible(); + + virtual void adjustMouseEvent(const Common::Event &event); protected: SdlEventSource *_evSrc; |