Removed SDL_SYS_JoystickNeedsPolling().

It was simpler to just have the polling (actually: hotplug detection)
 functions return immediately if it's not an appropriate time to poll.

Note that previously, if any joystick/controller was opened, we would poll
 every time anyhow, skipping this function.
This commit is contained in:
Ryan C. Gordon
2014-06-14 23:31:23 -04:00
parent 9e5504f89d
commit 446d19c4de
15 changed files with 51 additions and 165 deletions

View File

@@ -83,19 +83,6 @@ static struct
} SDL_EventQ = { NULL, SDL_TRUE };
static SDL_INLINE SDL_bool
SDL_ShouldPollJoystick()
{
#if !SDL_JOYSTICK_DISABLED
if ((!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] ||
SDL_JoystickEventState(SDL_QUERY)) &&
SDL_PrivateJoystickNeedsPolling()) {
return SDL_TRUE;
}
#endif
return SDL_FALSE;
}
/* Public functions */
void
@@ -403,7 +390,7 @@ SDL_PumpEvents(void)
}
#if !SDL_JOYSTICK_DISABLED
/* Check for joystick state change */
if (SDL_ShouldPollJoystick()) {
if ((!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] || SDL_JoystickEventState(SDL_QUERY))) {
SDL_JoystickUpdate();
}
#endif