diff options
author | Eugene Sandulenko | 2005-02-19 00:24:48 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-02-19 00:24:48 +0000 |
commit | ae6f40ebb64aa80c18a61500e83ab63fd21de7ef (patch) | |
tree | add46e125b6acc39299a7ed2e53edf04ab0536be | |
parent | c58cc5acaccc92f5a6d5cf6c52ebe253c6f202c8 (diff) | |
download | scummvm-rg350-ae6f40ebb64aa80c18a61500e83ab63fd21de7ef.tar.gz scummvm-rg350-ae6f40ebb64aa80c18a61500e83ab63fd21de7ef.tar.bz2 scummvm-rg350-ae6f40ebb64aa80c18a61500e83ab63fd21de7ef.zip |
Make cursor code more bulletproof
svn-id: r16809
-rw-r--r-- | backends/sdl/graphics.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp index 1687befdcd..cf1aa37242 100644 --- a/backends/sdl/graphics.cpp +++ b/backends/sdl/graphics.cpp @@ -1057,13 +1057,16 @@ void OSystem_SDL::warpMouse(int x, int y) { } void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor, int cursorTargetScale) { + if (w == 0 || h == 0) + return; + _mouseHotspotX = hotspot_x; _mouseHotspotY = hotspot_y; _mouseKeyColor = keycolor; _cursorTargetScale = cursorTargetScale; - + if (_mouseCurState.w != (int)w || _mouseCurState.h != (int)h) { _mouseCurState.w = w; _mouseCurState.h = h; @@ -1099,7 +1102,7 @@ void OSystem_SDL::blitCursor() { byte color; int w, h; - if (!_mouseOrigSurface) + if (!_mouseOrigSurface || !_mouseData) return; w = _mouseCurState.w; |