aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/linuxmotosdl
diff options
context:
space:
mode:
Diffstat (limited to 'backends/graphics/linuxmotosdl')
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp23
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h4
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