Joystick initialization fix submitted by Vitaliy Mikitchenko
authorSam Lantinga <slouken@libsdl.org>
Tue, 04 Sep 2001 22:38:01 +0000
changeset 165 6a4e09bbbbc0
parent 164 7434cc45d484
child 166 39877400bd1e
Joystick initialization fix submitted by Vitaliy Mikitchenko
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));