reset rumble on some conditions

This commit is contained in:
Alug committed 2024-09-28 01:37:54 +02:00
1 parent 6e085e302d
commit 6949efbb7e
5 files changed
+23

No files matched your search

+1
View File
@@ -3276,6 +3276,7 @@ void CL_Reset(void)
curl_running = false;
http_source[0] = '\0';
#endif
G_ResetAllDeviceRumbles();
// D_StartTitle should get done now, but the calling function will handle it
}
+2
View File
@@ -3122,6 +3122,8 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
else
S_ResumeAudio();
}
G_ResetAllDeviceRumbles();
}
static void Command_ReplayMarker(void)
+4
View File
@@ -1599,6 +1599,8 @@ void G_DoLoadLevel(boolean resetplayer)
// clear hud messages remains (usually from game startup)
CON_ClearHUD();
G_ResetAllDeviceRumbles();
}
static INT32 pausedelay = 0;
@@ -3017,6 +3019,8 @@ void G_AddPlayer(INT32 playernum)
void G_ExitLevel(void)
{
G_ResetAllDeviceRumbles();
if (gamestate == GS_LEVEL)
{
gameaction = ga_completed;
+15
View File
@@ -1013,6 +1013,21 @@ static void G_ResetPlayerDeviceRumble(INT32 player)
I_GamepadRumble(device_id, 0, 0, 0);
}
void G_ResetAllDeviceRumbles(void)
{
int i;
int devices;
devices = I_NumJoys();
for (i = 0; i < devices; i++)
{
INT32 device_id = G_GetDeviceForPlayer(i);
I_GamepadRumble(device_id, 0, 0, 0);
}
}
void G_PlayerDeviceRumble(INT32 player, UINT16 low_strength, UINT16 high_strength, UINT32 duration)
{
INT32 device_id;
+1
View File
@@ -138,6 +138,7 @@ UINT16 G_GetSkinColor(INT32 player);
INT32 G_GetDeviceForPlayer(INT32 player);
void G_SetPlayerGamepadIndicatorColor(INT32 player, UINT16 color);
void G_PlayerDeviceRumble(INT32 player, UINT16 low_strength, UINT16 high_strength, UINT32 duration);
void G_ResetAllDeviceRumbles(void);
// remaps the input event to a game control.
void G_MapEventsToControls(event_t *ev);