summaryrefslogtreecommitdiff
path: root/src/sdl
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdl')
-rw-r--r--src/sdl/sdl_input.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sdl/sdl_input.c b/src/sdl/sdl_input.c
index f241f225..affe2d41 100644
--- a/src/sdl/sdl_input.c
+++ b/src/sdl/sdl_input.c
@@ -298,11 +298,15 @@ IN_GobbleMotionEvents
static void IN_GobbleMotionEvents( void )
{
SDL_Event dummy[ 1 ];
+ int val = 0;
// Gobble any mouse motion events
SDL_PumpEvents( );
- while( SDL_PeepEvents( dummy, 1, SDL_GETEVENT,
- SDL_MOUSEMOTION, SDL_MOUSEMOTION ) ) { }
+ while( ( val = SDL_PeepEvents( dummy, 1, SDL_GETEVENT,
+ SDL_MOUSEMOTION, SDL_MOUSEMOTION ) ) > 0 ) { }
+
+ if ( val < 0 )
+ Com_Printf( "IN_GobbleMotionEvents failed: %s\n", SDL_GetError( ) );
}
/*
@@ -533,6 +537,9 @@ IN_ShutdownJoystick
*/
static void IN_ShutdownJoystick( void )
{
+ if ( !SDL_WasInit( SDL_INIT_JOYSTICK ) )
+ return;
+
if (stick)
{
SDL_JoystickClose(stick);