mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'fix-wipe-key-repeat' into 'master'
Reset all gamekeydown arrays for all devices Closes #513 See merge request KartKrew/Kart!1825
This commit is contained in:
commit
0e30dcc38e
7 changed files with 20 additions and 6 deletions
|
|
@ -1082,7 +1082,7 @@ void D_ClearState(void)
|
|||
paused = false;
|
||||
|
||||
// clear cmd building stuff
|
||||
memset(gamekeydown, 0, sizeof (gamekeydown));
|
||||
G_ResetAllDeviceGameKeyDown();
|
||||
G_ResetAllDeviceResponding();
|
||||
|
||||
// Reset the palette
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ void F_RunWipe(UINT8 wipemode, UINT8 wipetype, boolean drawMenu, const char *col
|
|||
// FIXME: Wipes SUCK and drop input events for some reason, causing stuck gamepad inputs.
|
||||
// It's better to ignore an intentional hold than to turn a tap into a phantom hold.
|
||||
// (If you're removing this, remove the one after the inner loop too!)
|
||||
memset(gamekeydown, 0, sizeof(gamekeydown));
|
||||
G_ResetAllDeviceGameKeyDown();
|
||||
|
||||
// lastwipetic should either be 0 or the tic we last wiped
|
||||
// on for fade-to-black
|
||||
|
|
@ -589,7 +589,7 @@ void F_RunWipe(UINT8 wipemode, UINT8 wipetype, boolean drawMenu, const char *col
|
|||
// FIXME: Wipes SUCK and drop input events for some reason, causing stuck gamepad inputs.
|
||||
// It's better to ignore an intentional hold than to turn a tap into a phantom hold.
|
||||
// (If you're removing this, remove the one before the inner loop too!)
|
||||
memset(gamekeydown, 0, sizeof(gamekeydown));
|
||||
G_ResetAllDeviceGameKeyDown();
|
||||
|
||||
if (fcolor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1181,7 +1181,7 @@ void G_DoLoadLevelEx(boolean resetplayer, gamestate_t newstate)
|
|||
}
|
||||
|
||||
// clear cmd building stuff
|
||||
memset(gamekeydown, 0, sizeof (gamekeydown));
|
||||
G_ResetAllDeviceGameKeyDown();
|
||||
G_ResetAllDeviceResponding();
|
||||
|
||||
// clear hud messages remains (usually from game startup)
|
||||
|
|
|
|||
|
|
@ -249,6 +249,19 @@ INT32* G_GetDeviceGameKeyDownArray(INT32 device)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void G_ResetAllDeviceGameKeyDown(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
memset(gamekeydown, 0, sizeof(gamekeydown));
|
||||
memset(g_gamekeydown_device0, 0, sizeof(g_gamekeydown_device0));
|
||||
|
||||
for (i = 0; i < g_available_gamepad_devices; i++)
|
||||
{
|
||||
memset(g_gamepad_gamekeydown[i], 0, sizeof(INT32) * NUMINPUTS);
|
||||
}
|
||||
}
|
||||
|
||||
boolean G_IsDeviceResponding(INT32 device)
|
||||
{
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ 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);
|
||||
void G_ResetAllDeviceGameKeyDown(void);
|
||||
|
||||
boolean G_IsDeviceResponding(INT32 device);
|
||||
void G_SetDeviceResponding(INT32 device, boolean responding);
|
||||
|
|
|
|||
|
|
@ -598,7 +598,7 @@ void M_StartControlPanel(void)
|
|||
{
|
||||
INT32 i;
|
||||
|
||||
memset(gamekeydown, 0, sizeof (gamekeydown));
|
||||
G_ResetAllDeviceGameKeyDown();
|
||||
memset(menucmd, 0, sizeof (menucmd));
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -547,7 +547,7 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
|
|||
{
|
||||
SDLforceUngrabMouse();
|
||||
}
|
||||
memset(gamekeydown, 0, sizeof(gamekeydown)); // TODO this is a scary memset
|
||||
G_ResetAllDeviceGameKeyDown();
|
||||
G_ResetAllDeviceResponding();
|
||||
|
||||
if (MOUSE_MENU)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue