summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2023-10-11 11:14:03 +0200
committerRay <[email protected]>2023-10-11 11:14:03 +0200
commit6ebfec99c50ef0b00bb693ac25ddebc01457153a (patch)
tree32e79bf7433d42a1b4b98a58b70b0f90086b0a6c /src
parentddca5251321ba5542fe59369765b48c1d4c6e5c9 (diff)
downloadraylib-6ebfec99c50ef0b00bb693ac25ddebc01457153a.tar.gz
raylib-6ebfec99c50ef0b00bb693ac25ddebc01457153a.zip
Added gamepad functions as generic for all platforms
Diffstat (limited to 'src')
-rw-r--r--src/rcore.c18
-rw-r--r--src/rcore_android.c12
-rw-r--r--src/rcore_desktop.c12
-rw-r--r--src/rcore_drm.c12
-rw-r--r--src/rcore_template.c12
-rw-r--r--src/rcore_web.c12
6 files changed, 8 insertions, 70 deletions
diff --git a/src/rcore.c b/src/rcore.c
index fa8f50d8..2e6d3213 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -2023,8 +2023,6 @@ void SetExitKey(int key)
//----------------------------------------------------------------------------------
// NOTE: Functions with a platform-specific implementation on rcore_<platform>.c
-//int GetGamepadAxisCount(int gamepad) **
-//const char *GetGamepadName(int gamepad) **
//int SetGamepadMappings(const char *mappings)
// Check if a gamepad is available
@@ -2038,10 +2036,10 @@ bool IsGamepadAvailable(int gamepad)
}
// Get gamepad internal name id
-//const char *GetGamepadName(int gamepad)
-//{
-// return CORE.Input.Gamepad.ready[gamepad];
-//}
+const char *GetGamepadName(int gamepad)
+{
+ return CORE.Input.Gamepad.name[gamepad];
+}
// Check if a gamepad button has been pressed once
bool IsGamepadButtonPressed(int gamepad, int button)
@@ -2094,10 +2092,10 @@ int GetGamepadButtonPressed(void)
}
// Get gamepad axis count
-//int GetGamepadAxisCount(int gamepad)
-//{
-// return CORE.Input.Gamepad.axisCount;
-//}
+int GetGamepadAxisCount(int gamepad)
+{
+ return CORE.Input.Gamepad.axisCount;
+}
// Get axis movement vector for a gamepad
float GetGamepadAxisMovement(int gamepad, int axis)
diff --git a/src/rcore_android.c b/src/rcore_android.c
index a9fc5fb9..d9f72894 100644
--- a/src/rcore_android.c
+++ b/src/rcore_android.c
@@ -635,18 +635,6 @@ void OpenURL(const char *url)
// Module Functions Definition: Inputs
//----------------------------------------------------------------------------------
-// Get gamepad internal name id
-const char *GetGamepadName(int gamepad)
-{
- return CORE.Input.Gamepad.name[gamepad];
-}
-
-// Get gamepad axis count
-int GetGamepadAxisCount(int gamepad)
-{
- return CORE.Input.Gamepad.axisCount;
-}
-
// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{
diff --git a/src/rcore_desktop.c b/src/rcore_desktop.c
index c410b713..eaef9517 100644
--- a/src/rcore_desktop.c
+++ b/src/rcore_desktop.c
@@ -1222,18 +1222,6 @@ void OpenURL(const char *url)
// Module Functions Definition: Inputs
//----------------------------------------------------------------------------------
-// Get gamepad internal name id
-const char *GetGamepadName(int gamepad)
-{
- return CORE.Input.Gamepad.name[gamepad];
-}
-
-// Get gamepad axis count
-int GetGamepadAxisCount(int gamepad)
-{
- return CORE.Input.Gamepad.axisCount;
-}
-
// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{
diff --git a/src/rcore_drm.c b/src/rcore_drm.c
index 3b688b8a..13d41bbb 100644
--- a/src/rcore_drm.c
+++ b/src/rcore_drm.c
@@ -739,18 +739,6 @@ void OpenURL(const char *url)
// Module Functions Definition: Inputs
//----------------------------------------------------------------------------------
-// Get gamepad internal name id
-const char *GetGamepadName(int gamepad)
-{
- return CORE.Input.Gamepad.name[gamepad];
-}
-
-// Get gamepad axis count
-int GetGamepadAxisCount(int gamepad)
-{
- return CORE.Input.Gamepad.axisCount;
-}
-
// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{
diff --git a/src/rcore_template.c b/src/rcore_template.c
index 3007e4f5..68a43b2c 100644
--- a/src/rcore_template.c
+++ b/src/rcore_template.c
@@ -563,18 +563,6 @@ void OpenURL(const char *url)
// Module Functions Definition: Inputs
//----------------------------------------------------------------------------------
-// Get gamepad internal name id
-const char *GetGamepadName(int gamepad)
-{
- return CORE.Input.Gamepad.name[gamepad];
-}
-
-// Get gamepad axis count
-int GetGamepadAxisCount(int gamepad)
-{
- return CORE.Input.Gamepad.axisCount;
-}
-
// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{
diff --git a/src/rcore_web.c b/src/rcore_web.c
index ed7dc265..00691e43 100644
--- a/src/rcore_web.c
+++ b/src/rcore_web.c
@@ -697,18 +697,6 @@ void OpenURL(const char *url)
// Module Functions Definition: Inputs
//----------------------------------------------------------------------------------
-// Get gamepad internal name id
-const char *GetGamepadName(int gamepad)
-{
- return CORE.Input.Gamepad.name[gamepad];
-}
-
-// Get gamepad axis count
-int GetGamepadAxisCount(int gamepad)
-{
- return CORE.Input.Gamepad.axisCount;
-}
-
// Set internal gamepad mappings
int SetGamepadMappings(const char *mappings)
{