From 8c165adde7698ec77deb2ecf7c355cd3d9cc10d6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 7 Apr 2020 23:17:27 -0400 Subject: [PATCH] joystick: Remove force_centering flag; we handle this on disconnect now. --- src/joystick/SDL_gamecontroller.c | 2 +- src/joystick/SDL_joystick.c | 6 ------ src/joystick/SDL_sysjoystick.h | 1 - src/joystick/darwin/SDL_sysjoystick.c | 1 - 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 9d92aa5cf123f..1468c427c056d 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -2139,7 +2139,7 @@ SDL_PrivateGameControllerButton(SDL_GameController * gamecontroller, SDL_GameCon return (0); } } else { - if (!SDL_TICKS_PASSED(now, gamecontroller->guide_button_down+SDL_MINIMUM_GUIDE_BUTTON_DELAY_MS) && !gamecontroller->joystick->force_recentering) { + if (!SDL_TICKS_PASSED(now, gamecontroller->guide_button_down+SDL_MINIMUM_GUIDE_BUTTON_DELAY_MS)) { gamecontroller->joystick->delayed_guide_button = SDL_TRUE; return (0); } diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index bc6c720fed641..3ec854e95f900 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1371,12 +1371,6 @@ SDL_JoystickUpdate(void) } SDL_UnlockJoysticks(); } - - /* !!! FIXME: only one thing sets force_recentering now (the Darwin code), see if that can be removed. */ - if (joystick->force_recentering) { - SDL_PrivateJoystickForceRecentering(joystick); - joystick->force_recentering = SDL_FALSE; - } } SDL_LockJoysticks(); diff --git a/src/joystick/SDL_sysjoystick.h b/src/joystick/SDL_sysjoystick.h index 5aa7577df696a..9cb85cddd72e1 100644 --- a/src/joystick/SDL_sysjoystick.h +++ b/src/joystick/SDL_sysjoystick.h @@ -67,7 +67,6 @@ struct _SDL_Joystick SDL_bool attached; SDL_bool is_game_controller; SDL_bool delayed_guide_button; /* SDL_TRUE if this device has the guide button event delayed */ - SDL_bool force_recentering; /* SDL_TRUE if this device needs to have its state reset to 0 */ SDL_JoystickPowerLevel epowerlevel; /* power level of this joystick, SDL_JOYSTICK_POWER_UNKNOWN if not supported */ struct _SDL_JoystickDriver *driver; diff --git a/src/joystick/darwin/SDL_sysjoystick.c b/src/joystick/darwin/SDL_sysjoystick.c index 86debc3f1958a..fbee787cad070 100644 --- a/src/joystick/darwin/SDL_sysjoystick.c +++ b/src/joystick/darwin/SDL_sysjoystick.c @@ -936,7 +936,6 @@ DARWIN_JoystickUpdate(SDL_Joystick * joystick) if (device->removed) { /* device was unplugged; ignore it. */ if (joystick->hwdata) { - joystick->force_recentering = SDL_TRUE; joystick->hwdata = NULL; } return;