mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-01 06:44:27 +08:00
Don't do name blacklisting if there's no name
This commit is contained in:
@@ -3233,8 +3233,8 @@ bool SDL_IsGamepad(SDL_JoystickID instance_id)
|
|||||||
*/
|
*/
|
||||||
bool SDL_ShouldIgnoreGamepad(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name)
|
bool SDL_ShouldIgnoreGamepad(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name)
|
||||||
{
|
{
|
||||||
int i;
|
if (name) {
|
||||||
for (i = 0; i < SDL_arraysize(SDL_gamepad_blacklist_words); i++) {
|
for (int i = 0; i < SDL_arraysize(SDL_gamepad_blacklist_words); i++) {
|
||||||
const struct SDL_GamepadBlacklistWords *blacklist_word = &SDL_gamepad_blacklist_words[i];
|
const struct SDL_GamepadBlacklistWords *blacklist_word = &SDL_gamepad_blacklist_words[i];
|
||||||
|
|
||||||
switch (blacklist_word->pos) {
|
switch (blacklist_word->pos) {
|
||||||
@@ -3257,6 +3257,7 @@ bool SDL_ShouldIgnoreGamepad(Uint16 vendor_id, Uint16 product_id, Uint16 version
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef SDL_PLATFORM_MACOS
|
#ifdef SDL_PLATFORM_MACOS
|
||||||
// On macOS do nothing here since we detect Steam virtual gamepads
|
// On macOS do nothing here since we detect Steam virtual gamepads
|
||||||
|
|||||||
Reference in New Issue
Block a user