From 25d0667f9e0106ba171d295864fe0cab23b52176 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 15 Oct 2002 04:26:20 +0000 Subject: [PATCH] Fixed joystick detection problem on Windows XP (thanks Maciej!) --- src/joystick/win32/SDL_mmjoystick.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/joystick/win32/SDL_mmjoystick.c b/src/joystick/win32/SDL_mmjoystick.c index 862e8c29d..bdcf28cde 100644 --- a/src/joystick/win32/SDL_mmjoystick.c +++ b/src/joystick/win32/SDL_mmjoystick.c @@ -38,7 +38,7 @@ static char rcsid = #include #include -#define MAX_JOYSTICKS 2 /* only 2 are supported in the multimedia API */ +#define MAX_JOYSTICKS 16 #define MAX_AXES 6 /* each joystick can have up to 6 axes */ #define MAX_BUTTONS 32 /* and 32 buttons */ #define AXIS_MIN -32768 /* minimum value for axis coordinate */ @@ -91,8 +91,10 @@ int SDL_SYS_JoystickInit(void) } - SYS_JoystickID[0] = JOYSTICKID1; - SYS_JoystickID[1] = JOYSTICKID2; + for ( i = 0; i < MAX_JOYSTICKS; i++ ) { + SYS_JoystickID[i] = JOYSTICKID1 + i; + } + for ( i = 0; (i < maxdevs); ++i ) {