joystick: Remove force_centering flag; we handle this on disconnect now.
authorRyan C. Gordon
Tue, 07 Apr 2020 23:17:27 -0400
changeset 1370899bad97fec09
parent 13707 a4f83b2a4105
child 13709 5b7e1fc67f6a
joystick: Remove force_centering flag; we handle this on disconnect now.
src/joystick/SDL_gamecontroller.c
src/joystick/SDL_joystick.c
src/joystick/SDL_sysjoystick.h
src/joystick/darwin/SDL_sysjoystick.c
     1.1 --- a/src/joystick/SDL_gamecontroller.c	Tue Apr 07 14:51:08 2020 -0400
     1.2 +++ b/src/joystick/SDL_gamecontroller.c	Tue Apr 07 23:17:27 2020 -0400
     1.3 @@ -2139,7 +2139,7 @@
     1.4                  return (0);
     1.5              }
     1.6          } else {
     1.7 -            if (!SDL_TICKS_PASSED(now, gamecontroller->guide_button_down+SDL_MINIMUM_GUIDE_BUTTON_DELAY_MS) && !gamecontroller->joystick->force_recentering) {
     1.8 +            if (!SDL_TICKS_PASSED(now, gamecontroller->guide_button_down+SDL_MINIMUM_GUIDE_BUTTON_DELAY_MS)) {
     1.9                  gamecontroller->joystick->delayed_guide_button = SDL_TRUE;
    1.10                  return (0);
    1.11              }
     2.1 --- a/src/joystick/SDL_joystick.c	Tue Apr 07 14:51:08 2020 -0400
     2.2 +++ b/src/joystick/SDL_joystick.c	Tue Apr 07 23:17:27 2020 -0400
     2.3 @@ -1371,12 +1371,6 @@
     2.4              }
     2.5              SDL_UnlockJoysticks();
     2.6          }
     2.7 -
     2.8 -        /* !!! FIXME: only one thing sets force_recentering now (the Darwin code), see if that can be removed. */
     2.9 -        if (joystick->force_recentering) {
    2.10 -            SDL_PrivateJoystickForceRecentering(joystick);
    2.11 -            joystick->force_recentering = SDL_FALSE;
    2.12 -        }
    2.13      }
    2.14  
    2.15      SDL_LockJoysticks();
     3.1 --- a/src/joystick/SDL_sysjoystick.h	Tue Apr 07 14:51:08 2020 -0400
     3.2 +++ b/src/joystick/SDL_sysjoystick.h	Tue Apr 07 23:17:27 2020 -0400
     3.3 @@ -67,7 +67,6 @@
     3.4      SDL_bool attached;
     3.5      SDL_bool is_game_controller;
     3.6      SDL_bool delayed_guide_button; /* SDL_TRUE if this device has the guide button event delayed */
     3.7 -    SDL_bool force_recentering; /* SDL_TRUE if this device needs to have its state reset to 0 */
     3.8      SDL_JoystickPowerLevel epowerlevel; /* power level of this joystick, SDL_JOYSTICK_POWER_UNKNOWN if not supported */
     3.9      struct _SDL_JoystickDriver *driver;
    3.10  
     4.1 --- a/src/joystick/darwin/SDL_sysjoystick.c	Tue Apr 07 14:51:08 2020 -0400
     4.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c	Tue Apr 07 23:17:27 2020 -0400
     4.3 @@ -936,7 +936,6 @@
     4.4  
     4.5      if (device->removed) {      /* device was unplugged; ignore it. */
     4.6          if (joystick->hwdata) {
     4.7 -            joystick->force_recentering = SDL_TRUE;
     4.8              joystick->hwdata = NULL;
     4.9          }
    4.10          return;