From 6f5151a8a7f782b4a521f8bfa25e3e82e336b609 Mon Sep 17 00:00:00 2001 From: ubkp <118854183+ubkp@users.noreply.github.com> Date: Sat, 23 Sep 2023 17:05:02 -0300 Subject: [PATCH] Relocate GetGamepadName and update SetGamepadMappings on android, desktop, web --- src/rcore_android.c | 16 ++++++++++------ src/rcore_desktop.c | 20 ++++++++++---------- src/rcore_web.c | 14 ++++++++------ 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/rcore_android.c b/src/rcore_android.c index e45749671..8ce84f677 100644 --- a/src/rcore_android.c +++ b/src/rcore_android.c @@ -1043,18 +1043,20 @@ void OpenURL(const char *url) } } -// Get gamepad internal name id -const char *GetGamepadName(int gamepad) -{ - return NULL; -} - // Get selected monitor physical width in millimetres int GetMonitorPhysicalWidth(int monitor) { return 0; } +// Get gamepad internal name id +const char *GetGamepadName(int gamepad) +{ + TRACELOG(LOG_INFO, "GetGamepadName not implemented in rcore_android.c"); + + return NULL; +} + // Get gamepad axis count int GetGamepadAxisCount(int gamepad) { @@ -1064,6 +1066,8 @@ int GetGamepadAxisCount(int gamepad) // Set internal gamepad mappings int SetGamepadMappings(const char *mappings) { + TRACELOG(LOG_INFO, "SetGamepadMappings not implemented in rcore_android.c"); + return 0; } diff --git a/src/rcore_desktop.c b/src/rcore_desktop.c index f8ccbe8cc..77962c00e 100644 --- a/src/rcore_desktop.c +++ b/src/rcore_desktop.c @@ -1496,16 +1496,6 @@ 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]) name = glfwGetJoystickName(gamepad); - - return name; -} - // Get selected monitor physical width in millimetres int GetMonitorPhysicalWidth(int monitor) { @@ -1522,6 +1512,16 @@ int GetMonitorPhysicalWidth(int monitor) return 0; } +// Get gamepad internal name id +const char *GetGamepadName(int gamepad) +{ + const char *name = NULL; + + if (CORE.Input.Gamepad.ready[gamepad]) name = glfwGetJoystickName(gamepad); + + return name; +} + // Get gamepad axis count int GetGamepadAxisCount(int gamepad) { diff --git a/src/rcore_web.c b/src/rcore_web.c index d6015aea7..fd7f8defb 100644 --- a/src/rcore_web.c +++ b/src/rcore_web.c @@ -1035,6 +1035,12 @@ void OpenURL(const char *url) } } +// Get selected monitor physical width in millimetres +int GetMonitorPhysicalWidth(int monitor) +{ + return 0; +} + // Get gamepad internal name id const char *GetGamepadName(int gamepad) { @@ -1045,12 +1051,6 @@ const char *GetGamepadName(int gamepad) return name; } -// Get selected monitor physical width in millimetres -int GetMonitorPhysicalWidth(int monitor) -{ - return 0; -} - // Get gamepad axis count int GetGamepadAxisCount(int gamepad) { @@ -1060,6 +1060,8 @@ int GetGamepadAxisCount(int gamepad) // Set internal gamepad mappings int SetGamepadMappings(const char *mappings) { + TRACELOG(LOG_INFO, "SetGamepadMappings not implemented in rcore_web.c"); + return 0; }