Commit b29480bd authored by Sam Lantinga's avatar Sam Lantinga

Joystick initialization fix submitted by Vitaliy Mikitchenko

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40166
parent 38014ea6
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment