enable libusb (to support switch 2 gamepads etc)
This commit is contained in:
parent
dadbdfe5a3
commit
55646fadab
2 changed files with 12 additions and 8 deletions
|
|
@ -1313,6 +1313,9 @@ void I_InitJoystick(UINT8 index)
|
|||
if (M_CheckParm("-nohidapi"))
|
||||
SDL_SetHintWithPriority("SDL_JOYSTICK_HIDAPI", "0", SDL_HINT_OVERRIDE);
|
||||
|
||||
if (M_CheckParm("-nolibusb"))
|
||||
SDL_SetHintWithPriority("SDL_HIDAPI_LIBUSB", "0", SDL_HINT_OVERRIDE);
|
||||
|
||||
if (SDL_WasInit(SDL_INIT_JOYSTICK) == 0)
|
||||
{
|
||||
CONS_Printf("I_InitJoystick()...\n");
|
||||
|
|
@ -1333,14 +1336,14 @@ void I_InitJoystick(UINT8 index)
|
|||
}
|
||||
|
||||
|
||||
if (SDL_WasInit(SDL_INIT_GAMEPAD) == 0)
|
||||
{
|
||||
if (!SDL_InitSubSystem(SDL_INIT_GAMEPAD))
|
||||
{
|
||||
CONS_Printf(M_GetText("Couldn't initialize gamepads: %s\n"), SDL_GetError());
|
||||
return;
|
||||
}
|
||||
}
|
||||
// if (SDL_WasInit(SDL_INIT_GAMEPAD) == 0)
|
||||
// {
|
||||
// if (!SDL_InitSubSystem(SDL_INIT_GAMEPAD))
|
||||
// {
|
||||
// CONS_Printf(M_GetText("Couldn't initialize gamepads: %s\n"), SDL_GetError());
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
joystick_list = SDL_GetJoysticks(&num_joy);
|
||||
|
||||
|
|
|
|||
1
thirdparty/cpm-sdl3.cmake
vendored
1
thirdparty/cpm-sdl3.cmake
vendored
|
|
@ -8,6 +8,7 @@ CPMAddPackage(
|
|||
"SDL_SHARED ${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}"
|
||||
"SDL_STATIC ${NOT_SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}"
|
||||
"SDL_TEST OFF"
|
||||
"SDL_HIDAPI_LIBUSB ON"
|
||||
"SDL3_DISABLE_SDL2MAIN ON"
|
||||
"SDL3_DISABLE_INSTALL ON"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue