mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 12:55:47 -04:00
SDLControllerInterface: Add option for PS4/PS5 enhanced mode
This commit is contained in:
@ -3169,6 +3169,7 @@ void CommonHostInterface::SetDefaultSettings(SettingsInterface& si)
|
||||
|
||||
si.SetStringValue("Main", "ControllerBackend",
|
||||
ControllerInterface::GetBackendName(ControllerInterface::GetDefaultBackend()));
|
||||
si.SetBoolValue("Main", "ControllerEnhancedMode", false);
|
||||
|
||||
si.SetBoolValue("Display", "InternalResolutionScreenshots", false);
|
||||
|
||||
|
@ -39,6 +39,16 @@ bool SDLControllerInterface::Initialize(CommonHostInterface* host_interface)
|
||||
}
|
||||
}
|
||||
|
||||
const bool ds4_rumble_enabled = host_interface->GetBoolSettingValue("Main", "ControllerEnhancedMode", false);
|
||||
if (ds4_rumble_enabled)
|
||||
{
|
||||
Log_InfoPrintf("Enabling PS4/PS5 enhanced mode.");
|
||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4, "true");
|
||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "true");
|
||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5, "true");
|
||||
SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "true");
|
||||
}
|
||||
|
||||
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC) < 0)
|
||||
{
|
||||
Log_ErrorPrintf("SDL_InitSubSystem(SDL_INIT_JOYSTICK |SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC) failed");
|
||||
|
Reference in New Issue
Block a user