Allow the product version to be different when trying to find a controller mapping

This is in the hope that revving the product version doesn't change the mapping, which is the case for some devices. In cases where it does, we just need to provide a mapping for each version of the product.
This commit is contained in:
Sam Lantinga 2022-08-28 23:01:30 -07:00
parent 761b9d1e49
commit 0b8b321f9e
3 changed files with 62 additions and 0 deletions

View file

@ -2017,6 +2017,27 @@ SDL_CreateJoystickGUIDForName(const char *name)
return SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_UNKNOWN, 0, 0, 0, name, 0, 0);
}
void SDL_SetJoystickGUIDVendor(SDL_JoystickGUID *guid, Uint16 vendor)
{
Uint16 *guid16 = (Uint16 *)guid->data;
guid16[2] = SDL_SwapLE16(vendor);
}
void SDL_SetJoystickGUIDProduct(SDL_JoystickGUID *guid, Uint16 product)
{
Uint16 *guid16 = (Uint16 *)guid->data;
guid16[4] = SDL_SwapLE16(product);
}
void SDL_SetJoystickGUIDVersion(SDL_JoystickGUID *guid, Uint16 version)
{
Uint16 *guid16 = (Uint16 *)guid->data;
guid16[6] = SDL_SwapLE16(version);
}
void
SDL_SetJoystickGUIDCRC(SDL_JoystickGUID *guid, Uint16 crc)
{