Add G_ResetAllDeviceRumbles

This commit is contained in:
Eidolon 2023-03-25 22:36:34 -05:00 committed by toaster
parent f7ca9043a1
commit 839f2a6d15
2 changed files with 17 additions and 0 deletions

View file

@ -357,6 +357,22 @@ void G_PlayerDeviceRumbleTriggers(INT32 player, UINT16 left_strength, UINT16 rig
I_GamepadRumbleTriggers(device_id, left_strength, right_strength);
}
void G_ResetAllDeviceRumbles(void)
{
int i;
int devices;
devices = G_GetNumAvailableGamepads();
for (i = 0; i < devices; i++)
{
INT32 device_id = G_GetAvailableGamepadDevice(i);
I_GamepadRumble(device_id, 0, 0);
I_GamepadRumbleTriggers(device_id, 0, 0);
}
}
static boolean AutomaticControllerReassignmentIsAllowed(INT32 device)
{
boolean device_is_gamepad = device > 0;

View file

@ -161,6 +161,7 @@ void G_SetPlayerGamepadIndicatorToPlayerColor(INT32 player);
void G_PlayerDeviceRumble(INT32 player, UINT16 low_strength, UINT16 high_strength);
void G_PlayerDeviceRumbleTriggers(INT32 player, UINT16 left_strength, UINT16 right_strength);
void G_ResetAllDeviceRumbles(void);
/// Get the gamekeydown array (NUMINPUTS values) for the given device, or NULL if the device id is invalid.
INT32* G_GetDeviceGameKeyDownArray(INT32 device);