comparison src/joystick/win32/SDL_mmjoystick.c @ 531:8450e66651ea

Fixed joystick detection problem on Windows XP (thanks Maciej!)
author Sam Lantinga <slouken@libsdl.org>
date Tue, 15 Oct 2002 04:26:20 +0000
parents f6ffac90895c
children b8d311d90021
comparison
equal deleted inserted replaced
530:d37660186e58 531:8450e66651ea
36 #include "SDL_joystick_c.h" 36 #include "SDL_joystick_c.h"
37 37
38 #include <windows.h> 38 #include <windows.h>
39 #include <mmsystem.h> 39 #include <mmsystem.h>
40 40
41 #define MAX_JOYSTICKS 2 /* only 2 are supported in the multimedia API */ 41 #define MAX_JOYSTICKS 16
42 #define MAX_AXES 6 /* each joystick can have up to 6 axes */ 42 #define MAX_AXES 6 /* each joystick can have up to 6 axes */
43 #define MAX_BUTTONS 32 /* and 32 buttons */ 43 #define MAX_BUTTONS 32 /* and 32 buttons */
44 #define AXIS_MIN -32768 /* minimum value for axis coordinate */ 44 #define AXIS_MIN -32768 /* minimum value for axis coordinate */
45 #define AXIS_MAX 32767 /* maximum value for axis coordinate */ 45 #define AXIS_MAX 32767 /* maximum value for axis coordinate */
46 #define JOY_AXIS_THRESHOLD (((AXIS_MAX)-(AXIS_MIN))/100) /* 1% motion */ 46 #define JOY_AXIS_THRESHOLD (((AXIS_MAX)-(AXIS_MIN))/100) /* 1% motion */
89 if ( maxdevs > MAX_JOYSTICKS ) { 89 if ( maxdevs > MAX_JOYSTICKS ) {
90 maxdevs = MAX_JOYSTICKS; 90 maxdevs = MAX_JOYSTICKS;
91 } 91 }
92 92
93 93
94 SYS_JoystickID[0] = JOYSTICKID1; 94 for ( i = 0; i < MAX_JOYSTICKS; i++ ) {
95 SYS_JoystickID[1] = JOYSTICKID2; 95 SYS_JoystickID[i] = JOYSTICKID1 + i;
96 }
97
96 98
97 for ( i = 0; (i < maxdevs); ++i ) { 99 for ( i = 0; (i < maxdevs); ++i ) {
98 100
99 /* added 8/31/2001 By Vitaliy Mikitchenko */ 101 /* added 8/31/2001 By Vitaliy Mikitchenko */
100 joyinfo.dwSize = sizeof(joyinfo); 102 joyinfo.dwSize = sizeof(joyinfo);