# HG changeset patch # User Sam Lantinga # Date 999643081 0 # Node ID 6a4e09bbbbc091f4b18353c1c2822931fa3fd612 # Parent 7434cc45d484400f2da4ae41cf581d3f27ab4126 Joystick initialization fix submitted by Vitaliy Mikitchenko diff -r 7434cc45d484 -r 6a4e09bbbbc0 src/joystick/win32/SDL_mmjoystick.c --- a/src/joystick/win32/SDL_mmjoystick.c Tue Sep 04 22:28:58 2001 +0000 +++ b/src/joystick/win32/SDL_mmjoystick.c Tue Sep 04 22:38:01 2001 +0000 @@ -85,14 +85,22 @@ 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));