Test for XInput

This commit is contained in:
kalaposfos13 2025-05-25 16:08:16 +02:00
parent d8fd8915a9
commit ed0f1a9132

View File

@ -349,13 +349,9 @@ u32 GameController::Poll() {
}
u8 GameControllers::GetGamepadIndexFromJoystickId(SDL_JoystickID id) {
auto& controllers = *Common::Singleton<GameControllers>::Instance();
for (int i = 0; i < 4; i++) {
if (SDL_GetGamepadID(controllers[i]->m_sdl_gamepad) == id) {
return controllers[i]->player_index;
}
}
UNREACHABLE_MSG("Handle {} is not registered!", id);
s32 index = SDL_GetGamepadPlayerIndex(SDL_GetGamepadFromID(id));
LOG_INFO(Input, "Gamepad index: {}", index);
return index;
}
} // namespace Input