Skip to content

Commit

Permalink
Update PLATFORM_DRM implementation of GetGamepadName
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfiber committed Oct 10, 2023
1 parent aacd3e2 commit 81641bf
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/rcore_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,15 +742,7 @@ void OpenURL(const char *url)
// Get gamepad internal name id
const char *GetGamepadName(int gamepad)
{
const char *name = NULL;

if (CORE.Input.Gamepad.ready[gamepad])
{
ioctl(platform.gamepadStreamFd[gamepad], JSIOCGNAME(64), &CORE.Input.Gamepad.name[gamepad]);
name = CORE.Input.Gamepad.name[gamepad];
}

return name;
return CORE.Input.Gamepad.name[gamepad];
}

// Get gamepad axis count
Expand Down Expand Up @@ -1954,6 +1946,8 @@ static void InitGamepad(void)
if (error != 0) TRACELOG(LOG_WARNING, "RPI: Failed to create gamepad input event thread");
else TRACELOG(LOG_INFO, "RPI: Gamepad device initialized successfully");
}

ioctl(platform.gamepadStreamFd[gamepad], JSIOCGNAME(64), &CORE.Input.Gamepad.name[i]);
}
}
}
Expand Down

0 comments on commit 81641bf

Please sign in to comment.