mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-08-27 09:01:34 +00:00
Removed SDL_GAMEPAD_TYPE_VIRTUAL, SDL_GAMEPAD_TYPE_AMAZON_LUNA, SDL_GAMEPAD_TYPE_GOOGLE_STADIA, and SDL_GAMEPAD_TYPE_NVIDIA_SHIELD
Removing SDL_GAMEPAD_TYPE_VIRTUAL allows a virtual controller to emulate another gamepad type. The other controller types can be treated as generic controllers by applications without special glyph or functionality treatment.
This commit is contained in:
@@ -64,7 +64,7 @@ static SDL_bool HIDAPI_DriverLuna_IsEnabled(void)
|
||||
|
||||
static SDL_bool HIDAPI_DriverLuna_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GamepadType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol)
|
||||
{
|
||||
return (type == SDL_GAMEPAD_TYPE_AMAZON_LUNA) ? SDL_TRUE : SDL_FALSE;
|
||||
return SDL_IsJoystickAmazonLunaController(vendor_id, product_id);
|
||||
}
|
||||
|
||||
static SDL_bool HIDAPI_DriverLuna_InitDevice(SDL_HIDAPI_Device *device)
|
||||
@@ -78,7 +78,6 @@ static SDL_bool HIDAPI_DriverLuna_InitDevice(SDL_HIDAPI_Device *device)
|
||||
}
|
||||
device->context = ctx;
|
||||
|
||||
device->type = SDL_GAMEPAD_TYPE_AMAZON_LUNA;
|
||||
HIDAPI_SetDeviceName(device, "Amazon Luna Controller");
|
||||
|
||||
return HIDAPI_JoystickConnected(device, NULL);
|
||||
|
||||
@@ -106,7 +106,7 @@ static SDL_bool HIDAPI_DriverShield_IsEnabled(void)
|
||||
|
||||
static SDL_bool HIDAPI_DriverShield_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GamepadType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol)
|
||||
{
|
||||
return (type == SDL_GAMEPAD_TYPE_NVIDIA_SHIELD) ? SDL_TRUE : SDL_FALSE;
|
||||
return SDL_IsJoystickNVIDIASHIELDController(vendor_id, product_id);
|
||||
}
|
||||
|
||||
static SDL_bool HIDAPI_DriverShield_InitDevice(SDL_HIDAPI_Device *device)
|
||||
@@ -120,7 +120,6 @@ static SDL_bool HIDAPI_DriverShield_InitDevice(SDL_HIDAPI_Device *device)
|
||||
}
|
||||
device->context = ctx;
|
||||
|
||||
device->type = SDL_GAMEPAD_TYPE_NVIDIA_SHIELD;
|
||||
HIDAPI_SetDeviceName(device, "NVIDIA SHIELD Controller");
|
||||
|
||||
return HIDAPI_JoystickConnected(device, NULL);
|
||||
|
||||
@@ -61,7 +61,7 @@ static SDL_bool HIDAPI_DriverStadia_IsEnabled(void)
|
||||
|
||||
static SDL_bool HIDAPI_DriverStadia_IsSupportedDevice(SDL_HIDAPI_Device *device, const char *name, SDL_GamepadType type, Uint16 vendor_id, Uint16 product_id, Uint16 version, int interface_number, int interface_class, int interface_subclass, int interface_protocol)
|
||||
{
|
||||
return (type == SDL_GAMEPAD_TYPE_GOOGLE_STADIA) ? SDL_TRUE : SDL_FALSE;
|
||||
return SDL_IsJoystickGoogleStadiaController(vendor_id, product_id);
|
||||
}
|
||||
|
||||
static SDL_bool HIDAPI_DriverStadia_InitDevice(SDL_HIDAPI_Device *device)
|
||||
@@ -84,7 +84,6 @@ static SDL_bool HIDAPI_DriverStadia_InitDevice(SDL_HIDAPI_Device *device)
|
||||
}
|
||||
}
|
||||
|
||||
device->type = SDL_GAMEPAD_TYPE_GOOGLE_STADIA;
|
||||
HIDAPI_SetDeviceName(device, "Google Stadia Controller");
|
||||
|
||||
return HIDAPI_JoystickConnected(device, NULL);
|
||||
|
||||
@@ -1176,7 +1176,7 @@ static SDL_bool HIDAPI_IsEquivalentToDevice(Uint16 vendor_id, Uint16 product_id,
|
||||
if (vendor_id == USB_VENDOR_NVIDIA) {
|
||||
/* If we're looking for the NVIDIA SHIELD controller Xbox interface, match it against any NVIDIA SHIELD controller */
|
||||
if (product_id == 0xb400 &&
|
||||
device->type == SDL_GAMEPAD_TYPE_NVIDIA_SHIELD) {
|
||||
SDL_IsJoystickNVIDIASHIELDController(vendor_id, product_id)) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user