mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 23:42:11 +00:00
Merge these two loops together in Controller_GetFromID
This commit is contained in:
parent
14065fb23f
commit
4a19294ca8
1 changed files with 2 additions and 9 deletions
|
@ -534,17 +534,10 @@ void I_SetGamepadDigital(UINT8 which, boolean enable)
|
|||
|
||||
static gamepad_t *Controller_GetFromID(SDL_JoystickID which, UINT8 *found)
|
||||
{
|
||||
SDL_JoystickID joyid[NUM_GAMEPADS];
|
||||
|
||||
UINT8 i;
|
||||
|
||||
// Determine the joystick IDs for each current open controller
|
||||
for (i = 0; i < NUM_GAMEPADS; i++)
|
||||
joyid[i] = SDL_JoystickInstanceID(controllers[i].joydev);
|
||||
|
||||
for (i = 0; i < NUM_GAMEPADS; i++)
|
||||
for (UINT8 i = 0; i < NUM_GAMEPADS; i++)
|
||||
{
|
||||
if (which == joyid[i])
|
||||
if (which == SDL_JoystickInstanceID(controllers[i].joydev))
|
||||
{
|
||||
(*found) = i;
|
||||
return &gamepads[i];
|
||||
|
|
Loading…
Reference in a new issue