diff options
author | James Brown | 2003-01-09 08:07:13 +0000 |
---|---|---|
committer | James Brown | 2003-01-09 08:07:13 +0000 |
commit | 819a96d05bbc79eff8453b1206c986638fa766f1 (patch) | |
tree | 3953e5629fc9c81154d851805f96cc4f2bd2e6f1 | |
parent | b946f08105dff0c4c1f4aeffc0d98ba968725848 (diff) | |
download | scummvm-rg350-819a96d05bbc79eff8453b1206c986638fa766f1.tar.gz scummvm-rg350-819a96d05bbc79eff8453b1206c986638fa766f1.tar.bz2 scummvm-rg350-819a96d05bbc79eff8453b1206c986638fa766f1.zip |
Patch 664895: Cannon fixes. Porters, this requires a new OSystem interface function
svn-id: r6365
-rw-r--r-- | backends/sdl/sdl-common.cpp | 10 | ||||
-rw-r--r-- | backends/sdl/sdl-common.h | 5 |
2 files changed, 15 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) { diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index 3cfbb2ecf4..b4e2b324db 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -52,6 +52,11 @@ public: // Set the position of the mouse cursor void set_mouse_pos(int x, int y); + + // Warp the mouse cursor. Where set_mouse_pos() only informs the + // backend of the mouse cursor's current position, this function + // actually moves the cursor to the specified position. + void warp_mouse(int x, int y); // Set the bitmap that's used when drawing the cursor. void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y); |