aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/sdl/graphics.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp
index af817ddd78..f074f0e34d 100644
--- a/backends/sdl/graphics.cpp
+++ b/backends/sdl/graphics.cpp
@@ -1013,9 +1013,6 @@ void OSystem_SDL::undraw_mouse() {
return;
_mouseDrawn = false;
- if (SDL_LockSurface(_overlayVisible ? _tmpscreen : _screen) == -1)
- error("SDL_LockSurface failed: %s", SDL_GetError());
-
int old_mouse_x = _mouseCurState.x - _mouseHotspotX;
int old_mouse_y = _mouseCurState.y - _mouseHotspotY;
int old_mouse_w = _mouseCurState.w;
@@ -1040,6 +1037,8 @@ void OSystem_SDL::undraw_mouse() {
if (old_mouse_w <= 0 || old_mouse_h <= 0)
return;
+ if (SDL_LockSurface(_overlayVisible ? _tmpscreen : _screen) == -1)
+ error("SDL_LockSurface failed: %s", SDL_GetError());
int x, y;
if (!_overlayVisible) {