Mercurial > sdl-ios-xcode
diff src/video/SDL_cursor.c @ 595:591b438ab94a
Don't warp the mouse when a video mode hasn't been set
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 07 Feb 2003 05:47:15 +0000 |
parents | 5c74ac147358 |
children | b8d311d90021 |
line wrap: on
line diff
--- a/src/video/SDL_cursor.c Tue Feb 04 21:05:20 2003 +0000 +++ b/src/video/SDL_cursor.c Fri Feb 07 05:47:15 2003 +0000 @@ -295,6 +295,11 @@ SDL_VideoDevice *video = current_video; SDL_VideoDevice *this = current_video; + if ( !video || !SDL_PublicSurface ) { + SDL_SetError("A video mode must be set before warping mouse"); + return; + } + /* If we have an offset video mode, offset the mouse coordinates */ x += (this->screen->offset % this->screen->pitch) / this->screen->format->BytesPerPixel;