mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01:00
Minor cleanup
This commit is contained in:
@@ -3425,16 +3425,6 @@ bool SDL_IsJoystickVIRTUAL(SDL_GUID guid)
|
|||||||
return (guid.data[14] == 'v') ? true : false;
|
return (guid.data[14] == 'v') ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SDL_IsJoystickDrumKit(Uint16 vendor_id, Uint16 product_id)
|
|
||||||
{
|
|
||||||
return SDL_VIDPIDInList(vendor_id, product_id, &drum_devices);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDL_IsJoystickGuitar(Uint16 vendor_id, Uint16 product_id)
|
|
||||||
{
|
|
||||||
return SDL_VIDPIDInList(vendor_id, product_id, &guitar_devices);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SDL_IsJoystickWheel(Uint16 vendor_id, Uint16 product_id)
|
bool SDL_IsJoystickWheel(Uint16 vendor_id, Uint16 product_id)
|
||||||
{
|
{
|
||||||
return SDL_VIDPIDInList(vendor_id, product_id, &wheel_devices);
|
return SDL_VIDPIDInList(vendor_id, product_id, &wheel_devices);
|
||||||
@@ -3455,6 +3445,16 @@ static bool SDL_IsJoystickThrottle(Uint16 vendor_id, Uint16 product_id)
|
|||||||
return SDL_VIDPIDInList(vendor_id, product_id, &throttle_devices);
|
return SDL_VIDPIDInList(vendor_id, product_id, &throttle_devices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool SDL_IsJoystickGuitar(Uint16 vendor_id, Uint16 product_id)
|
||||||
|
{
|
||||||
|
return SDL_VIDPIDInList(vendor_id, product_id, &guitar_devices);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool SDL_IsJoystickDrumKit(Uint16 vendor_id, Uint16 product_id)
|
||||||
|
{
|
||||||
|
return SDL_VIDPIDInList(vendor_id, product_id, &drum_devices);
|
||||||
|
}
|
||||||
|
|
||||||
static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_GUID guid)
|
static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_GUID guid)
|
||||||
{
|
{
|
||||||
Uint16 vendor;
|
Uint16 vendor;
|
||||||
@@ -3462,13 +3462,6 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_GUID guid)
|
|||||||
|
|
||||||
SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL);
|
SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL);
|
||||||
|
|
||||||
if (SDL_IsJoystickDrumKit(vendor, product)) {
|
|
||||||
return SDL_JOYSTICK_TYPE_DRUM_KIT;
|
|
||||||
}
|
|
||||||
if (SDL_IsJoystickGuitar(vendor, product)) {
|
|
||||||
return SDL_JOYSTICK_TYPE_GUITAR;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SDL_IsJoystickWheel(vendor, product)) {
|
if (SDL_IsJoystickWheel(vendor, product)) {
|
||||||
return SDL_JOYSTICK_TYPE_WHEEL;
|
return SDL_JOYSTICK_TYPE_WHEEL;
|
||||||
}
|
}
|
||||||
@@ -3485,6 +3478,14 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_GUID guid)
|
|||||||
return SDL_JOYSTICK_TYPE_THROTTLE;
|
return SDL_JOYSTICK_TYPE_THROTTLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SDL_IsJoystickGuitar(vendor, product)) {
|
||||||
|
return SDL_JOYSTICK_TYPE_GUITAR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SDL_IsJoystickDrumKit(vendor, product)) {
|
||||||
|
return SDL_JOYSTICK_TYPE_DRUM_KIT;
|
||||||
|
}
|
||||||
|
|
||||||
if (SDL_IsJoystickXInput(guid)) {
|
if (SDL_IsJoystickXInput(guid)) {
|
||||||
// XInput GUID, get the type based on the XInput device subtype
|
// XInput GUID, get the type based on the XInput device subtype
|
||||||
switch (guid.data[15]) {
|
switch (guid.data[15]) {
|
||||||
|
|||||||
@@ -174,12 +174,6 @@ extern bool SDL_IsJoystickVIRTUAL(SDL_GUID guid);
|
|||||||
// Function to return whether a joystick is a wheel
|
// Function to return whether a joystick is a wheel
|
||||||
extern bool SDL_IsJoystickWheel(Uint16 vendor_id, Uint16 product_id);
|
extern bool SDL_IsJoystickWheel(Uint16 vendor_id, Uint16 product_id);
|
||||||
|
|
||||||
// Function to return whether a joystick is a guitar
|
|
||||||
extern bool SDL_IsJoystickGuitar(Uint16 vendor_id, Uint16 product_id);
|
|
||||||
|
|
||||||
// Function to return whether a joystick is a drum kit
|
|
||||||
extern bool SDL_IsJoystickDrumKit(Uint16 vendor_id, Uint16 product_id);
|
|
||||||
|
|
||||||
// Function to return whether a joystick should be ignored
|
// Function to return whether a joystick should be ignored
|
||||||
extern bool SDL_ShouldIgnoreJoystick(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name);
|
extern bool SDL_ShouldIgnoreJoystick(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user