mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-20 02:08:13 +00:00
Added functions to get the platform dependent name for a joystick or game controller
This commit is contained in:
@@ -456,7 +456,7 @@ EnumJoystickDetectCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext)
|
||||
pNewJoystick = *(JoyStick_DeviceData**)pContext;
|
||||
while (pNewJoystick) {
|
||||
/* update GUIDs of joysticks with matching paths, in case they're not open yet */
|
||||
if (SDL_strcmp(pNewJoystick->hidPath, hidPath) == 0) {
|
||||
if (SDL_strcmp(pNewJoystick->path, hidPath) == 0) {
|
||||
/* if we are replacing the front of the list then update it */
|
||||
if (pNewJoystick == *(JoyStick_DeviceData**)pContext) {
|
||||
*(JoyStick_DeviceData**)pContext = pNewJoystick->pNext;
|
||||
@@ -483,7 +483,7 @@ EnumJoystickDetectCallback(LPCDIDEVICEINSTANCE pDeviceInstance, LPVOID pContext)
|
||||
CHECK(pNewJoystick);
|
||||
|
||||
SDL_zerop(pNewJoystick);
|
||||
SDL_strlcpy(pNewJoystick->hidPath, hidPath, SDL_arraysize(pNewJoystick->hidPath));
|
||||
SDL_strlcpy(pNewJoystick->path, hidPath, SDL_arraysize(pNewJoystick->path));
|
||||
SDL_memcpy(&pNewJoystick->dxdevice, pDeviceInstance, sizeof(DIDEVICEINSTANCE));
|
||||
SDL_memset(pNewJoystick->guid.data, 0, sizeof(pNewJoystick->guid.data));
|
||||
|
||||
|
Reference in New Issue
Block a user