aboutsummaryrefslogtreecommitdiff
path: root/backends/sdl/graphics.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2005-02-19 00:24:48 +0000
committerEugene Sandulenko2005-02-19 00:24:48 +0000
commitae6f40ebb64aa80c18a61500e83ab63fd21de7ef (patch)
treeadd46e125b6acc39299a7ed2e53edf04ab0536be /backends/sdl/graphics.cpp
parentc58cc5acaccc92f5a6d5cf6c52ebe253c6f202c8 (diff)
downloadscummvm-rg350-ae6f40ebb64aa80c18a61500e83ab63fd21de7ef.tar.gz
scummvm-rg350-ae6f40ebb64aa80c18a61500e83ab63fd21de7ef.tar.bz2
scummvm-rg350-ae6f40ebb64aa80c18a61500e83ab63fd21de7ef.zip
Make cursor code more bulletproof
svn-id: r16809
Diffstat (limited to 'backends/sdl/graphics.cpp')
-rw-r--r--backends/sdl/graphics.cpp7
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;