Skip to content

Commit

Permalink
Joystick initialization fix submitted by Vitaliy Mikitchenko
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 4, 2001
1 parent 9752142 commit 63b0424
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/joystick/win32/SDL_mmjoystick.c
Expand Up @@ -85,14 +85,22 @@ int SDL_SYS_JoystickInit(void)

numdevs = 0;
maxdevs = joyGetNumDevs();

if ( maxdevs > MAX_JOYSTICKS ) {
maxdevs = MAX_JOYSTICKS;
}


SYS_JoystickID[0] = JOYSTICKID1;
SYS_JoystickID[1] = JOYSTICKID2;

for ( i = 0; (i < maxdevs); ++i ) {

/* added 8/31/2001 By Vitaliy Mikitchenko */
joyinfo.dwSize = sizeof(joyinfo);
joyinfo.dwFlags = JOY_RETURNALL;
/* end addition */

result = joyGetPosEx(SYS_JoystickID[i], &joyinfo);
if ( result == JOYERR_NOERROR ) {
result = joyGetDevCaps(SYS_JoystickID[i], &joycaps, sizeof(joycaps));
Expand Down

0 comments on commit 63b0424

Please sign in to comment.