SWITCH: bitmask joystick buttons to fit HidControllerKeys

SWITCH: improve and comment test
This commit is contained in:
cpasjuste
2018-03-16 19:19:48 +01:00
committed by Dave Murphy
parent 25454343e2
commit 42c8e7e175
2 changed files with 32 additions and 12 deletions

View File

@@ -181,7 +181,8 @@ SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
for (int i = 0; i < sizeof(pad_mapping) / sizeof(*pad_mapping); i++) {
if (changed & pad_mapping[i]) {
SDL_PrivateJoystickButton(
joystick, (Uint8) i, (Uint8) ((pad[index].buttons & pad_mapping[i]) ? SDL_PRESSED : SDL_RELEASED));
joystick, (Uint8) BIT(i),
(Uint8) ((pad[index].buttons & pad_mapping[i]) ? SDL_PRESSED : SDL_RELEASED));
}
}
}