aboutsummaryrefslogtreecommitdiff
path: root/backends/sdl/sdl-common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/sdl/sdl-common.cpp')
-rw-r--r--backends/sdl/sdl-common.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp
index 1bc2ec1416..32a885fecf 100644
--- a/backends/sdl/sdl-common.cpp
+++ b/backends/sdl/sdl-common.cpp
@@ -398,6 +398,16 @@ void OSystem_SDL_Common::set_mouse_pos(int x, int y) {
undraw_mouse();
}
}
+
+void OSystem_SDL_Common::warp_mouse(int x, int y) {
+ // FIXME: For whatever reason, I can't get CMI's cannon scene to work
+ // properly in fullscreen mode unless I temporarily show the mouse
+ // cursor here.
+ if (_full_screen) SDL_ShowCursor(SDL_ENABLE);
+ SDL_WarpMouse(x * _scaleFactor, y * _scaleFactor);
+ if (_full_screen) SDL_ShowCursor(SDL_DISABLE);
+ set_mouse_pos(x, y);
+}
void OSystem_SDL_Common::set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) {