Add ability to push controls to a control map without having to manually track controlmap index IDs

This commit is contained in:
2026-05-06 12:02:36 -04:00
parent c3847160da
commit 87a5b1da21
3 changed files with 76 additions and 43 deletions

View File

@@ -1,7 +1,7 @@
#ifndef _SDL_GAMECONTROLLERDB_H_
#define _SDL_GAMECONTROLLERDB_H_
// Taken from https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/refs/heads/master/gamecontrollerdb.txt on Wed May 6 11:06:20 AM EDT 2026
// Taken from https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/refs/heads/master/gamecontrollerdb.txt on Wed May 6 11:52:34 AM EDT 2026
#define SDL_GAMECONTROLLER_DB_LEN 2225

View File

@@ -21,6 +21,7 @@ typedef struct {
typedef struct {
actor *target;
int nextMap;
SDL3GControl controls[MAX_CONTROLS];
SDL_KeyboardID kbid;
SDL_JoystickID jsid;
@@ -37,5 +38,7 @@ akerr_ErrorContext AKERR_NOIGNORE *controller_handle_button_up(void *appstate, S
akerr_ErrorContext AKERR_NOIGNORE *controller_handle_added(void *appstate, SDL_Event *event);
akerr_ErrorContext AKERR_NOIGNORE *controller_handle_removed(void *appstate, SDL_Event *event);
akerr_ErrorContext AKERR_NOIGNORE *SDL3G_controller_pushmap(int controlmapid, SDL3GControl *control);
akerr_ErrorContext AKERR_NOIGNORE *SDL3G_controller_default(int controlmapid, char *actorname, int kbid, int jsid);
#endif // _CONTROLLER_H_