mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-31 14:29:14 +08:00
Only use the default gamepad mapping if an automatic mapping isn't available
Fixes https://github.com/libsdl-org/SDL/issues/10162
(cherry picked from commit 0f8054cf87)
This commit is contained in:
@@ -1377,9 +1377,6 @@ static ControllerMapping_t *SDL_PrivateGetControllerMappingForNameAndGUID(const
|
|||||||
}
|
}
|
||||||
#endif /* __LINUX__ */
|
#endif /* __LINUX__ */
|
||||||
|
|
||||||
if (!mapping) {
|
|
||||||
mapping = s_pDefaultMapping;
|
|
||||||
}
|
|
||||||
return mapping;
|
return mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1492,6 +1489,9 @@ static ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mapping) {
|
||||||
|
mapping = s_pDefaultMapping;
|
||||||
|
}
|
||||||
return mapping;
|
return mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2045,7 +2045,7 @@ SDL_bool SDL_IsGameControllerNameAndGUID(const char *name, SDL_JoystickGUID guid
|
|||||||
|
|
||||||
SDL_LockJoysticks();
|
SDL_LockJoysticks();
|
||||||
{
|
{
|
||||||
if (SDL_PrivateGetControllerMappingForNameAndGUID(name, guid) != NULL) {
|
if (s_pDefaultMapping || SDL_PrivateGetControllerMappingForNameAndGUID(name, guid) != NULL) {
|
||||||
retval = SDL_TRUE;
|
retval = SDL_TRUE;
|
||||||
} else {
|
} else {
|
||||||
retval = SDL_FALSE;
|
retval = SDL_FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user