gamepad: Replace GetNumMappings/GetMappingByIndex with a single function.

Now it returns an array and optional count, to match other SDL3 APIs.
This commit is contained in:
Ryan C. Gordon
2023-11-29 11:15:48 -05:00
parent dfee3f9e92
commit dd47da8a5c
9 changed files with 78 additions and 79 deletions

View File

@@ -189,7 +189,6 @@ SDL3_0.0.0 {
SDL_GetGamepadJoystick;
SDL_GetGamepadMapping;
SDL_GetGamepadMappingForGUID;
SDL_GetGamepadMappingForIndex;
SDL_GetGamepadName;
SDL_GetGamepadPath;
SDL_GetGamepadPlayerIndex;
@@ -250,7 +249,6 @@ SDL3_0.0.0 {
SDL_GetMouseState;
SDL_GetNaturalDisplayOrientation;
SDL_GetNumAllocations;
SDL_GetNumGamepadMappings;
SDL_GetNumGamepadTouchpadFingers;
SDL_GetNumGamepadTouchpads;
SDL_GetNumJoystickAxes;
@@ -963,6 +961,7 @@ SDL3_0.0.0 {
SDL_GetBooleanProperty;
SDL_CreateTextureWithProperties;
SDL_CreateRendererWithProperties;
SDL_GetGamepadMappings;
# extra symbols go here (don't modify this line)
local: *;
};

View File

@@ -213,7 +213,6 @@
#define SDL_GetGamepadJoystick SDL_GetGamepadJoystick_REAL
#define SDL_GetGamepadMapping SDL_GetGamepadMapping_REAL
#define SDL_GetGamepadMappingForGUID SDL_GetGamepadMappingForGUID_REAL
#define SDL_GetGamepadMappingForIndex SDL_GetGamepadMappingForIndex_REAL
#define SDL_GetGamepadName SDL_GetGamepadName_REAL
#define SDL_GetGamepadPath SDL_GetGamepadPath_REAL
#define SDL_GetGamepadPlayerIndex SDL_GetGamepadPlayerIndex_REAL
@@ -274,7 +273,6 @@
#define SDL_GetMouseState SDL_GetMouseState_REAL
#define SDL_GetNaturalDisplayOrientation SDL_GetNaturalDisplayOrientation_REAL
#define SDL_GetNumAllocations SDL_GetNumAllocations_REAL
#define SDL_GetNumGamepadMappings SDL_GetNumGamepadMappings_REAL
#define SDL_GetNumGamepadTouchpadFingers SDL_GetNumGamepadTouchpadFingers_REAL
#define SDL_GetNumGamepadTouchpads SDL_GetNumGamepadTouchpads_REAL
#define SDL_GetNumJoystickAxes SDL_GetNumJoystickAxes_REAL
@@ -988,3 +986,4 @@
#define SDL_GetBooleanProperty SDL_GetBooleanProperty_REAL
#define SDL_CreateTextureWithProperties SDL_CreateTextureWithProperties_REAL
#define SDL_CreateRendererWithProperties SDL_CreateRendererWithProperties_REAL
#define SDL_GetGamepadMappings SDL_GetGamepadMappings_REAL

View File

@@ -272,7 +272,6 @@ SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadInstanceVendor,(SDL_JoystickID a),(a),retur
SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetGamepadJoystick,(SDL_Gamepad *a),(a),return)
SDL_DYNAPI_PROC(char*,SDL_GetGamepadMapping,(SDL_Gamepad *a),(a),return)
SDL_DYNAPI_PROC(char*,SDL_GetGamepadMappingForGUID,(SDL_JoystickGUID a),(a),return)
SDL_DYNAPI_PROC(char*,SDL_GetGamepadMappingForIndex,(int a),(a),return)
SDL_DYNAPI_PROC(const char*,SDL_GetGamepadName,(SDL_Gamepad *a),(a),return)
SDL_DYNAPI_PROC(const char*,SDL_GetGamepadPath,(SDL_Gamepad *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_GetGamepadPlayerIndex,(SDL_Gamepad *a),(a),return)
@@ -333,7 +332,6 @@ SDL_DYNAPI_PROC(SDL_Window*,SDL_GetMouseFocus,(void),(),return)
SDL_DYNAPI_PROC(Uint32,SDL_GetMouseState,(float *a, float *b),(a,b),return)
SDL_DYNAPI_PROC(SDL_DisplayOrientation,SDL_GetNaturalDisplayOrientation,(SDL_DisplayID a),(a),return)
SDL_DYNAPI_PROC(int,SDL_GetNumAllocations,(void),(),return)
SDL_DYNAPI_PROC(int,SDL_GetNumGamepadMappings,(void),(),return)
SDL_DYNAPI_PROC(int,SDL_GetNumGamepadTouchpadFingers,(SDL_Gamepad *a, int b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_GetNumGamepadTouchpads,(SDL_Gamepad *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_GetNumJoystickAxes,(SDL_Joystick *a),(a),return)
@@ -1013,3 +1011,4 @@ SDL_DYNAPI_PROC(int,SDL_SetBooleanProperty,(SDL_PropertiesID a, const char *b, S
SDL_DYNAPI_PROC(SDL_bool,SDL_GetBooleanProperty,(SDL_PropertiesID a, const char *b, SDL_bool c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTextureWithProperties,(SDL_Renderer *a, SDL_PropertiesID b),(a,b),return)
SDL_DYNAPI_PROC(SDL_Renderer*,SDL_CreateRendererWithProperties,(SDL_PropertiesID a),(a),return)
SDL_DYNAPI_PROC(char**,SDL_GetGamepadMappings,(int *a),(a),return)