aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
Diffstat (limited to 'backends')
-rw-r--r--backends/sdl/graphics.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp
index cdbb23472e..138e70d279 100644
--- a/backends/sdl/graphics.cpp
+++ b/backends/sdl/graphics.cpp
@@ -1117,15 +1117,48 @@ void OSystem_SDL::setShakePos(int shake_pos) {
void OSystem_SDL::showOverlay() {
assert (_transactionMode == kTransactionNone);
+ int x, y;
+
+ if (_overlayVisible)
+ return;
+
_overlayVisible = true;
+
+ // Since resolution could change, put mouse to adjusted position
+ // Fixes bug #1349059
+ x = _mouseCurState.x * _overlayScale;
+ y = _mouseCurState.y * _overlayScale;
+
+ if (_adjustAspectRatio)
+ y = real2Aspect(y);
+
+ warpMouse(x, y);
+
clearOverlay();
}
void OSystem_SDL::hideOverlay() {
assert (_transactionMode == kTransactionNone);
+ if (!_overlayVisible)
+ return;
+
+ int x, y;
+
_overlayVisible = false;
+
+ // Since resolution could change, put mouse to adjusted position
+ // Fixes bug #1349059
+ x = _mouseCurState.x / _overlayScale;
+ y = _mouseCurState.y / _overlayScale;
+
+ if (_adjustAspectRatio)
+ y = real2Aspect(y);
+
+ warpMouse(x, y);
+
clearOverlay();
+
_forceFull = true;
}