mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-20 22:35:41 +00:00
Renamed *FromInstanceID() to *FromID()
This commit is contained in:
@@ -240,7 +240,7 @@ SDL3_0.0.0 {
|
||||
SDL_GetGamepadButtonLabelForType;
|
||||
SDL_GetGamepadConnectionState;
|
||||
SDL_GetGamepadFirmwareVersion;
|
||||
SDL_GetGamepadFromInstanceID;
|
||||
SDL_GetGamepadFromID;
|
||||
SDL_GetGamepadFromPlayerIndex;
|
||||
SDL_GetGamepadGUIDFromID;
|
||||
SDL_GetGamepadID;
|
||||
@@ -280,7 +280,7 @@ SDL3_0.0.0 {
|
||||
SDL_GetGrabbedWindow;
|
||||
SDL_GetHapticEffectStatus;
|
||||
SDL_GetHapticFeatures;
|
||||
SDL_GetHapticFromInstanceID;
|
||||
SDL_GetHapticFromID;
|
||||
SDL_GetHapticID;
|
||||
SDL_GetHapticName;
|
||||
SDL_GetHapticNameFromID;
|
||||
@@ -296,7 +296,7 @@ SDL3_0.0.0 {
|
||||
SDL_GetJoystickButton;
|
||||
SDL_GetJoystickConnectionState;
|
||||
SDL_GetJoystickFirmwareVersion;
|
||||
SDL_GetJoystickFromInstanceID;
|
||||
SDL_GetJoystickFromID;
|
||||
SDL_GetJoystickFromPlayerIndex;
|
||||
SDL_GetJoystickGUID;
|
||||
SDL_GetJoystickGUIDFromID;
|
||||
@@ -379,7 +379,7 @@ SDL3_0.0.0 {
|
||||
SDL_GetPropertyType;
|
||||
SDL_GetRGB;
|
||||
SDL_GetRGBA;
|
||||
SDL_GetRealGamepadInstanceType;
|
||||
SDL_GetRealGamepadTypeFromID;
|
||||
SDL_GetRealGamepadType;
|
||||
SDL_GetRectAndLineIntersection;
|
||||
SDL_GetRectAndLineIntersectionFloat;
|
||||
@@ -418,7 +418,7 @@ SDL3_0.0.0 {
|
||||
SDL_GetScancodeName;
|
||||
SDL_GetSemaphoreValue;
|
||||
SDL_GetSensorData;
|
||||
SDL_GetSensorFromInstanceID;
|
||||
SDL_GetSensorFromID;
|
||||
SDL_GetSensorID;
|
||||
SDL_GetSensorName;
|
||||
SDL_GetSensorNameFromID;
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
#define SDL_GetGamepadButtonLabelForType SDL_GetGamepadButtonLabelForType_REAL
|
||||
#define SDL_GetGamepadConnectionState SDL_GetGamepadConnectionState_REAL
|
||||
#define SDL_GetGamepadFirmwareVersion SDL_GetGamepadFirmwareVersion_REAL
|
||||
#define SDL_GetGamepadFromInstanceID SDL_GetGamepadFromInstanceID_REAL
|
||||
#define SDL_GetGamepadFromID SDL_GetGamepadFromID_REAL
|
||||
#define SDL_GetGamepadFromPlayerIndex SDL_GetGamepadFromPlayerIndex_REAL
|
||||
#define SDL_GetGamepadGUIDFromID SDL_GetGamepadGUIDFromID_REAL
|
||||
#define SDL_GetGamepadID SDL_GetGamepadID_REAL
|
||||
@@ -305,7 +305,7 @@
|
||||
#define SDL_GetGrabbedWindow SDL_GetGrabbedWindow_REAL
|
||||
#define SDL_GetHapticEffectStatus SDL_GetHapticEffectStatus_REAL
|
||||
#define SDL_GetHapticFeatures SDL_GetHapticFeatures_REAL
|
||||
#define SDL_GetHapticFromInstanceID SDL_GetHapticFromInstanceID_REAL
|
||||
#define SDL_GetHapticFromID SDL_GetHapticFromID_REAL
|
||||
#define SDL_GetHapticID SDL_GetHapticID_REAL
|
||||
#define SDL_GetHapticName SDL_GetHapticName_REAL
|
||||
#define SDL_GetHapticNameFromID SDL_GetHapticNameFromID_REAL
|
||||
@@ -321,7 +321,7 @@
|
||||
#define SDL_GetJoystickButton SDL_GetJoystickButton_REAL
|
||||
#define SDL_GetJoystickConnectionState SDL_GetJoystickConnectionState_REAL
|
||||
#define SDL_GetJoystickFirmwareVersion SDL_GetJoystickFirmwareVersion_REAL
|
||||
#define SDL_GetJoystickFromInstanceID SDL_GetJoystickFromInstanceID_REAL
|
||||
#define SDL_GetJoystickFromID SDL_GetJoystickFromID_REAL
|
||||
#define SDL_GetJoystickFromPlayerIndex SDL_GetJoystickFromPlayerIndex_REAL
|
||||
#define SDL_GetJoystickGUID SDL_GetJoystickGUID_REAL
|
||||
#define SDL_GetJoystickGUIDFromID SDL_GetJoystickGUIDFromID_REAL
|
||||
@@ -404,7 +404,7 @@
|
||||
#define SDL_GetPropertyType SDL_GetPropertyType_REAL
|
||||
#define SDL_GetRGB SDL_GetRGB_REAL
|
||||
#define SDL_GetRGBA SDL_GetRGBA_REAL
|
||||
#define SDL_GetRealGamepadInstanceType SDL_GetRealGamepadInstanceType_REAL
|
||||
#define SDL_GetRealGamepadTypeFromID SDL_GetRealGamepadTypeFromID_REAL
|
||||
#define SDL_GetRealGamepadType SDL_GetRealGamepadType_REAL
|
||||
#define SDL_GetRectAndLineIntersection SDL_GetRectAndLineIntersection_REAL
|
||||
#define SDL_GetRectAndLineIntersectionFloat SDL_GetRectAndLineIntersectionFloat_REAL
|
||||
@@ -443,7 +443,7 @@
|
||||
#define SDL_GetScancodeName SDL_GetScancodeName_REAL
|
||||
#define SDL_GetSemaphoreValue SDL_GetSemaphoreValue_REAL
|
||||
#define SDL_GetSensorData SDL_GetSensorData_REAL
|
||||
#define SDL_GetSensorFromInstanceID SDL_GetSensorFromInstanceID_REAL
|
||||
#define SDL_GetSensorFromID SDL_GetSensorFromID_REAL
|
||||
#define SDL_GetSensorID SDL_GetSensorID_REAL
|
||||
#define SDL_GetSensorName SDL_GetSensorName_REAL
|
||||
#define SDL_GetSensorNameFromID SDL_GetSensorNameFromID_REAL
|
||||
|
||||
@@ -285,7 +285,7 @@ SDL_DYNAPI_PROC(SDL_GamepadButtonLabel,SDL_GetGamepadButtonLabel,(SDL_Gamepad *a
|
||||
SDL_DYNAPI_PROC(SDL_GamepadButtonLabel,SDL_GetGamepadButtonLabelForType,(SDL_GamepadType a, SDL_GamepadButton b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickConnectionState,SDL_GetGamepadConnectionState,(SDL_Gamepad *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadFirmwareVersion,(SDL_Gamepad *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromInstanceID,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromID,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromPlayerIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetGamepadGUIDFromID,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetGamepadID,(SDL_Gamepad *a),(a),return)
|
||||
@@ -325,7 +325,7 @@ SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetGlobalProperties,(void),(),return)
|
||||
SDL_DYNAPI_PROC(SDL_Window*,SDL_GetGrabbedWindow,(void),(),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetHapticEffectStatus,(SDL_Haptic *a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(Uint32,SDL_GetHapticFeatures,(SDL_Haptic *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Haptic*,SDL_GetHapticFromInstanceID,(SDL_HapticID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Haptic*,SDL_GetHapticFromID,(SDL_HapticID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_HapticID,SDL_GetHapticID,(SDL_Haptic *a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetHapticName,(SDL_Haptic *a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetHapticNameFromID,(SDL_HapticID a),(a),return)
|
||||
@@ -341,7 +341,7 @@ SDL_DYNAPI_PROC(int,SDL_GetJoystickBall,(SDL_Joystick *a, int b, int *c, int *d)
|
||||
SDL_DYNAPI_PROC(Uint8,SDL_GetJoystickButton,(SDL_Joystick *a, int b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickConnectionState,SDL_GetJoystickConnectionState,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickFirmwareVersion,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromInstanceID,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromID,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromPlayerIndex,(int a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUID,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUIDFromID,(SDL_JoystickID a),(a),return)
|
||||
@@ -424,7 +424,7 @@ SDL_DYNAPI_PROC(char*,SDL_GetPrimarySelectionText,(void),(),return)
|
||||
SDL_DYNAPI_PROC(SDL_PropertyType,SDL_GetPropertyType,(SDL_PropertiesID a, const char *b),(a,b),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f),(a,b,c,d,e,f),)
|
||||
SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),)
|
||||
SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadInstanceType,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadTypeFromID,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadType,(SDL_Gamepad *a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersection,(const SDL_Rect *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return)
|
||||
SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersectionFloat,(const SDL_FRect *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return)
|
||||
@@ -463,7 +463,7 @@ SDL_DYNAPI_PROC(SDL_Scancode,SDL_GetScancodeFromName,(const char *a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetScancodeName,(SDL_Scancode a),(a),return)
|
||||
SDL_DYNAPI_PROC(Uint32,SDL_GetSemaphoreValue,(SDL_Semaphore *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_GetSensorData,(SDL_Sensor *a, float *b, int c),(a,b,c),return)
|
||||
SDL_DYNAPI_PROC(SDL_Sensor*,SDL_GetSensorFromInstanceID,(SDL_SensorID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_Sensor*,SDL_GetSensorFromID,(SDL_SensorID a),(a),return)
|
||||
SDL_DYNAPI_PROC(SDL_SensorID,SDL_GetSensorID,(SDL_Sensor *a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetSensorName,(SDL_Sensor *a),(a),return)
|
||||
SDL_DYNAPI_PROC(const char*,SDL_GetSensorNameFromID,(SDL_SensorID a),(a),return)
|
||||
|
||||
@@ -166,7 +166,7 @@ SDL_Haptic *SDL_OpenHaptic(SDL_HapticID instance_id)
|
||||
return haptic;
|
||||
}
|
||||
|
||||
SDL_Haptic *SDL_GetHapticFromInstanceID(SDL_HapticID instance_id)
|
||||
SDL_Haptic *SDL_GetHapticFromID(SDL_HapticID instance_id)
|
||||
{
|
||||
SDL_Haptic *haptic;
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@ static void PopMappingChangeTracking(void)
|
||||
for (i = 0; tracker->joysticks[i]; ++i) {
|
||||
/* Looking up the new mapping might create one and associate it with the gamepad (and generate events) */
|
||||
SDL_JoystickID joystick = tracker->joysticks[i];
|
||||
SDL_Gamepad *gamepad = SDL_GetGamepadFromInstanceID(joystick);
|
||||
SDL_Gamepad *gamepad = SDL_GetGamepadFromID(joystick);
|
||||
GamepadMapping_t *new_mapping = SDL_PrivateGetGamepadMapping(joystick, SDL_FALSE);
|
||||
GamepadMapping_t *old_mapping = gamepad ? gamepad->mapping : tracker->joystick_mappings[i];
|
||||
|
||||
@@ -1324,7 +1324,7 @@ static void SDL_UpdateGamepadType(SDL_Gamepad *gamepad)
|
||||
}
|
||||
}
|
||||
if (gamepad->type == SDL_GAMEPAD_TYPE_UNKNOWN) {
|
||||
gamepad->type = SDL_GetRealGamepadInstanceType(gamepad->joystick->instance_id);
|
||||
gamepad->type = SDL_GetRealGamepadTypeFromID(gamepad->joystick->instance_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2497,10 +2497,10 @@ SDL_GamepadType SDL_GetGamepadTypeFromID(SDL_JoystickID instance_id)
|
||||
if (type != SDL_GAMEPAD_TYPE_UNKNOWN) {
|
||||
return type;
|
||||
}
|
||||
return SDL_GetRealGamepadInstanceType(instance_id);
|
||||
return SDL_GetRealGamepadTypeFromID(instance_id);
|
||||
}
|
||||
|
||||
SDL_GamepadType SDL_GetRealGamepadInstanceType(SDL_JoystickID instance_id)
|
||||
SDL_GamepadType SDL_GetRealGamepadTypeFromID(SDL_JoystickID instance_id)
|
||||
{
|
||||
SDL_GamepadType type = SDL_GAMEPAD_TYPE_UNKNOWN;
|
||||
const SDL_SteamVirtualGamepadInfo *info;
|
||||
@@ -3506,7 +3506,7 @@ SDL_Joystick *SDL_GetGamepadJoystick(SDL_Gamepad *gamepad)
|
||||
/*
|
||||
* Return the SDL_Gamepad associated with an instance id.
|
||||
*/
|
||||
SDL_Gamepad *SDL_GetGamepadFromInstanceID(SDL_JoystickID joyid)
|
||||
SDL_Gamepad *SDL_GetGamepadFromID(SDL_JoystickID joyid)
|
||||
{
|
||||
SDL_Gamepad *gamepad;
|
||||
|
||||
@@ -3534,7 +3534,7 @@ SDL_Gamepad *SDL_GetGamepadFromPlayerIndex(int player_index)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetJoystickFromPlayerIndex(player_index);
|
||||
if (joystick) {
|
||||
retval = SDL_GetGamepadFromInstanceID(joystick->instance_id);
|
||||
retval = SDL_GetGamepadFromID(joystick->instance_id);
|
||||
}
|
||||
}
|
||||
SDL_UnlockJoysticks();
|
||||
|
||||
@@ -1585,7 +1585,7 @@ SDL_JoystickID SDL_GetJoystickID(SDL_Joystick *joystick)
|
||||
/*
|
||||
* Return the SDL_Joystick associated with an instance id.
|
||||
*/
|
||||
SDL_Joystick *SDL_GetJoystickFromInstanceID(SDL_JoystickID instance_id)
|
||||
SDL_Joystick *SDL_GetJoystickFromID(SDL_JoystickID instance_id)
|
||||
{
|
||||
SDL_Joystick *joystick;
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ static void HIDAPI_DriverGameCube_HandleJoystickPacket(SDL_HIDAPI_Device *device
|
||||
return; /* How do we handle this packet? */
|
||||
}
|
||||
|
||||
joystick = SDL_GetJoystickFromInstanceID(ctx->joysticks[i]);
|
||||
joystick = SDL_GetJoystickFromID(ctx->joysticks[i]);
|
||||
if (!joystick) {
|
||||
/* Hasn't been opened yet, skip */
|
||||
return;
|
||||
@@ -295,7 +295,7 @@ static void HIDAPI_DriverGameCube_HandleNintendoPacket(SDL_HIDAPI_Device *device
|
||||
ResetAxisRange(ctx, i);
|
||||
HIDAPI_JoystickConnected(device, &ctx->joysticks[i]);
|
||||
}
|
||||
joystick = SDL_GetJoystickFromInstanceID(ctx->joysticks[i]);
|
||||
joystick = SDL_GetJoystickFromID(ctx->joysticks[i]);
|
||||
|
||||
/* Hasn't been opened yet, skip */
|
||||
if (!joystick) {
|
||||
|
||||
@@ -356,7 +356,7 @@ static SDL_bool HIDAPI_DriverLuna_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size = 0;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ static SDL_bool HIDAPI_DriverPS3_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
@@ -958,7 +958,7 @@ static SDL_bool HIDAPI_DriverPS3ThirdParty_UpdateDevice(SDL_HIDAPI_Device *devic
|
||||
int size;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
@@ -1297,7 +1297,7 @@ static SDL_bool HIDAPI_DriverPS3SonySixaxis_UpdateDevice(SDL_HIDAPI_Device *devi
|
||||
int size;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -1256,7 +1256,7 @@ static SDL_bool HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
Uint64 now = SDL_GetTicks();
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
}
|
||||
|
||||
while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) {
|
||||
|
||||
@@ -1492,7 +1492,7 @@ static SDL_bool HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
Uint64 now = SDL_GetTicks();
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
}
|
||||
|
||||
while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) {
|
||||
|
||||
@@ -471,7 +471,7 @@ static SDL_bool HIDAPI_DriverShield_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
ShieldCommandReport_t *cmd_resp_report;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ static SDL_bool HIDAPI_DriverStadia_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size = 0;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -1092,7 +1092,7 @@ static SDL_bool HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
SDL_Joystick *joystick = NULL;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ static SDL_bool HIDAPI_DriverSteamDeck_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
ValveInReport_t *pInReport = (ValveInReport_t *)data;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
if (joystick == NULL) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -2562,7 +2562,7 @@ static SDL_bool HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
Uint64 now = SDL_GetTicks();
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
}
|
||||
|
||||
while ((size = ReadInput(ctx)) > 0) {
|
||||
|
||||
@@ -1517,7 +1517,7 @@ static SDL_bool HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
Uint64 now;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -337,7 +337,7 @@ static SDL_bool HIDAPI_DriverXbox360_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size = 0;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ static SDL_bool HIDAPI_DriverXbox360W_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
}
|
||||
|
||||
while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) {
|
||||
|
||||
@@ -1574,7 +1574,7 @@ static SDL_bool HIDAPI_DriverXboxOne_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
int size;
|
||||
|
||||
if (device->num_joysticks > 0) {
|
||||
joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]);
|
||||
joystick = SDL_GetJoystickFromID(device->joysticks[0]);
|
||||
} else {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
@@ -679,7 +679,7 @@ static void HIDAPI_UpdateJoystickSerial(SDL_HIDAPI_Device *device)
|
||||
SDL_AssertJoysticksLocked();
|
||||
|
||||
for (i = 0; i < device->num_joysticks; ++i) {
|
||||
SDL_Joystick *joystick = SDL_GetJoystickFromInstanceID(device->joysticks[i]);
|
||||
SDL_Joystick *joystick = SDL_GetJoystickFromID(device->joysticks[i]);
|
||||
if (joystick && device->serial) {
|
||||
SDL_free(joystick->serial);
|
||||
joystick->serial = SDL_strdup(device->serial);
|
||||
@@ -834,7 +834,7 @@ void HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickID joyst
|
||||
|
||||
for (i = 0; i < device->num_joysticks; ++i) {
|
||||
if (device->joysticks[i] == joystickID) {
|
||||
SDL_Joystick *joystick = SDL_GetJoystickFromInstanceID(joystickID);
|
||||
SDL_Joystick *joystick = SDL_GetJoystickFromID(joystickID);
|
||||
if (joystick) {
|
||||
HIDAPI_JoystickClose(joystick);
|
||||
}
|
||||
@@ -899,7 +899,7 @@ void HIDAPI_UpdateDeviceProperties(SDL_HIDAPI_Device *device)
|
||||
SDL_LockJoysticks();
|
||||
|
||||
for (i = 0; i < device->num_joysticks; ++i) {
|
||||
SDL_Joystick *joystick = SDL_GetJoystickFromInstanceID(device->joysticks[i]);
|
||||
SDL_Joystick *joystick = SDL_GetJoystickFromID(device->joysticks[i]);
|
||||
if (joystick) {
|
||||
HIDAPI_UpdateJoystickProperties(device, joystick);
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ SDL_Sensor *SDL_OpenSensor(SDL_SensorID instance_id)
|
||||
/*
|
||||
* Find the SDL_Sensor that owns this instance id
|
||||
*/
|
||||
SDL_Sensor *SDL_GetSensorFromInstanceID(SDL_SensorID instance_id)
|
||||
SDL_Sensor *SDL_GetSensorFromID(SDL_SensorID instance_id)
|
||||
{
|
||||
SDL_Sensor *sensor;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user