mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-22 11:18:14 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user