From 12a0cbbb25a27d33d7761723e75aa48862fad962 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 23 Sep 2009 06:57:12 +0000 Subject: [PATCH] Potentially fixed bug #774 There's a mismatch between ndev and MAX_INPUTS --- src/video/windx5/SDL_dx5events.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/video/windx5/SDL_dx5events.c b/src/video/windx5/SDL_dx5events.c index ebbdd3095..744a47972 100644 --- a/src/video/windx5/SDL_dx5events.c +++ b/src/video/windx5/SDL_dx5events.c @@ -43,7 +43,7 @@ #endif /* The keyboard and mouse device input */ -#define MAX_INPUTS 16 /* Maximum of 16-1 input devices */ +#define MAX_INPUTS 2 #define INPUT_QSIZE 512 /* Buffer up to 512 input messages */ static LPDIRECTINPUT dinput = NULL; @@ -264,6 +264,8 @@ static void DX5_DInputQuit(_THIS) SDL_DIdev[i] = NULL; } } + SDL_DIndev = 0; + /* Release DirectInput */ IDirectInput_Release(dinput); dinput = NULL; @@ -664,15 +666,17 @@ static int DX5_CheckInput(_THIS, int timeout, BOOL processInput) /* Pump the DirectInput flow */ if ( SDL_GetAppState() & SDL_APPINPUTFOCUS ) { - for ( i=0; i