SDL API renaming: SDL_gamecontroller.h

SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been renamed to match.

Fixes https://github.com/libsdl-org/SDL/issues/6885
This commit is contained in:
Sam Lantinga
2022-12-27 09:46:24 -08:00
parent ab0c5cf07d
commit 659abc721a
73 changed files with 3890 additions and 3391 deletions

View File

@@ -173,7 +173,7 @@ int SDL_InitSubSystem(Uint32 flags)
SDL_DBus_Init();
#endif
if ((flags & SDL_INIT_GAMECONTROLLER)) {
if ((flags & SDL_INIT_GAMEPAD)) {
/* game controller implies joystick */
flags |= SDL_INIT_JOYSTICK;
}
@@ -275,15 +275,15 @@ int SDL_InitSubSystem(Uint32 flags)
#endif
}
if ((flags & SDL_INIT_GAMECONTROLLER)) {
if ((flags & SDL_INIT_GAMEPAD)) {
#if !SDL_JOYSTICK_DISABLED
if (SDL_PrivateShouldInitSubsystem(SDL_INIT_GAMECONTROLLER)) {
if (SDL_GameControllerInit() < 0) {
if (SDL_PrivateShouldInitSubsystem(SDL_INIT_GAMEPAD)) {
if (SDL_GamepadInit() < 0) {
goto quit_and_error;
}
}
SDL_PrivateSubsystemRefCountIncr(SDL_INIT_GAMECONTROLLER);
flags_initialized |= SDL_INIT_GAMECONTROLLER;
SDL_PrivateSubsystemRefCountIncr(SDL_INIT_GAMEPAD);
flags_initialized |= SDL_INIT_GAMEPAD;
#else
SDL_SetError("SDL not built with joystick support");
goto quit_and_error;
@@ -349,14 +349,14 @@ void SDL_QuitSubSystem(Uint32 flags)
#endif
#if !SDL_JOYSTICK_DISABLED
if ((flags & SDL_INIT_GAMECONTROLLER)) {
if ((flags & SDL_INIT_GAMEPAD)) {
/* game controller implies joystick */
flags |= SDL_INIT_JOYSTICK;
if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_GAMECONTROLLER)) {
SDL_GameControllerQuit();
if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_GAMEPAD)) {
SDL_GamepadQuit();
}
SDL_PrivateSubsystemRefCountDecr(SDL_INIT_GAMECONTROLLER);
SDL_PrivateSubsystemRefCountDecr(SDL_INIT_GAMEPAD);
}
if ((flags & SDL_INIT_JOYSTICK)) {