SDL_PrivateJoystickForceRecentering: fix wrong loop counter usage.

The typo seems to have been added by commit c7782fd6142b
This commit is contained in:
Ozkan Sezer 2020-11-15 17:10:15 +03:00
parent 1ed36d21b0
commit c0f7325b85
1 changed files with 3 additions and 15 deletions

View File

@ -469,24 +469,17 @@ SDL_JoystickOpen(int device_index)
return joystick; return joystick;
} }
int int
SDL_JoystickAttachVirtual(SDL_JoystickType type, SDL_JoystickAttachVirtual(SDL_JoystickType type,
int naxes, int naxes, int nbuttons, int nhats)
int nbuttons,
int nhats)
{ {
#if SDL_JOYSTICK_VIRTUAL #if SDL_JOYSTICK_VIRTUAL
return SDL_JoystickAttachVirtualInner(type, return SDL_JoystickAttachVirtualInner(type, naxes, nbuttons, nhats);
naxes,
nbuttons,
nhats);
#else #else
return SDL_SetError("SDL not built with virtual-joystick support"); return SDL_SetError("SDL not built with virtual-joystick support");
#endif #endif
} }
int int
SDL_JoystickDetachVirtual(int device_index) SDL_JoystickDetachVirtual(int device_index)
{ {
@ -509,7 +502,6 @@ SDL_JoystickDetachVirtual(int device_index)
#endif #endif
} }
SDL_bool SDL_bool
SDL_JoystickIsVirtual(int device_index) SDL_JoystickIsVirtual(int device_index)
{ {
@ -532,7 +524,6 @@ SDL_JoystickIsVirtual(int device_index)
#endif #endif
} }
int int
SDL_JoystickSetVirtualAxis(SDL_Joystick * joystick, int axis, Sint16 value) SDL_JoystickSetVirtualAxis(SDL_Joystick * joystick, int axis, Sint16 value)
{ {
@ -543,7 +534,6 @@ SDL_JoystickSetVirtualAxis(SDL_Joystick * joystick, int axis, Sint16 value)
#endif #endif
} }
int int
SDL_JoystickSetVirtualButton(SDL_Joystick * joystick, int button, Uint8 value) SDL_JoystickSetVirtualButton(SDL_Joystick * joystick, int button, Uint8 value)
{ {
@ -554,7 +544,6 @@ SDL_JoystickSetVirtualButton(SDL_Joystick * joystick, int button, Uint8 value)
#endif #endif
} }
int int
SDL_JoystickSetVirtualHat(SDL_Joystick * joystick, int hat, Uint8 value) SDL_JoystickSetVirtualHat(SDL_Joystick * joystick, int hat, Uint8 value)
{ {
@ -565,7 +554,6 @@ SDL_JoystickSetVirtualHat(SDL_Joystick * joystick, int hat, Uint8 value)
#endif #endif
} }
/* /*
* Checks to make sure the joystick is valid. * Checks to make sure the joystick is valid.
*/ */
@ -1226,7 +1214,7 @@ SDL_PrivateJoystickForceRecentering(SDL_Joystick *joystick)
} }
for (i = 0; i < joystick->ntouchpads; i++) { for (i = 0; i < joystick->ntouchpads; i++) {
SDL_JoystickTouchpadInfo *touchpad = &joystick->touchpads[j]; SDL_JoystickTouchpadInfo *touchpad = &joystick->touchpads[i];
for (j = 0; j < touchpad->nfingers; ++j) { for (j = 0; j < touchpad->nfingers; ++j) {
SDL_PrivateJoystickTouchpad(joystick, i, j, SDL_RELEASED, 0.0f, 0.0f, 0.0f); SDL_PrivateJoystickTouchpad(joystick, i, j, SDL_RELEASED, 0.0f, 0.0f, 0.0f);