mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-03 14:50:15 +02:00
SDL_ShouldIgnoreGamepad() should take product IDs rather than a guid.
This lets us early out when scanning for new hardware more quickly.
This commit is contained in:
@@ -329,15 +329,14 @@ static bool IsJoystick(const char *path, int *fd, char **name_return, Uint16 *ve
|
||||
SDL_Log("Joystick: %s, bustype = %d, vendor = 0x%.4x, product = 0x%.4x, version = %d\n", name, inpid.bustype, inpid.vendor, inpid.product, inpid.version);
|
||||
#endif
|
||||
|
||||
*guid = SDL_CreateJoystickGUID(inpid.bustype, inpid.vendor, inpid.product, inpid.version, NULL, product_string, 0, 0);
|
||||
|
||||
if (SDL_ShouldIgnoreJoystick(name, *guid)) {
|
||||
if (SDL_ShouldIgnoreJoystick(inpid.vendor, inpid.product, inpid.version, name)) {
|
||||
SDL_free(name);
|
||||
return false;
|
||||
}
|
||||
*name_return = name;
|
||||
*vendor_return = inpid.vendor;
|
||||
*product_return = inpid.product;
|
||||
*guid = SDL_CreateJoystickGUID(inpid.bustype, inpid.vendor, inpid.product, inpid.version, NULL, product_string, 0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user