Got the suite rebuilding, most tests pass, actor and sprite are failing

This commit is contained in:
2026-05-03 23:57:55 -04:00
parent f475dfb6ee
commit 6763b5629f
36 changed files with 734 additions and 664 deletions

View File

@@ -7,7 +7,7 @@
SDL3GControlMap GAME_ControlMaps[MAX_CONTROL_MAPS];
ErrorContext *controller_handle_event(void *appstate, SDL_Event *event)
akerr_ErrorContext *controller_handle_event(void *appstate, SDL_Event *event)
{
int i = 0;
int j = 0;
@@ -55,16 +55,16 @@ _controller_handle_event_success:
SUCCEED_RETURN(errctx);
}
ErrorContext *gamepad_handle_button_down(void *appstate, SDL_Event *event)
akerr_ErrorContext *gamepad_handle_button_down(void *appstate, SDL_Event *event)
{
actor *player = NULL;
PREPARE_ERROR(errctx);
FAIL_ZERO_RETURN(errctx, appstate, ERR_NULLPOINTER, "NULL appstate");
FAIL_ZERO_RETURN(errctx, appstate, ERR_NULLPOINTER, "NULL event");
FAIL_ZERO_RETURN(errctx, appstate, AKERR_NULLPOINTER, "NULL appstate");
FAIL_ZERO_RETURN(errctx, appstate, AKERR_NULLPOINTER, "NULL event");
player = SDL_GetPointerProperty(REGISTRY_ACTOR, "player", NULL);
FAIL_ZERO_RETURN(errctx, appstate, ERR_NULLPOINTER, "Player actor does not exist");
FAIL_ZERO_RETURN(errctx, appstate, AKERR_NULLPOINTER, "Player actor does not exist");
if ( event->gbutton.button == SDL_GAMEPAD_BUTTON_DPAD_DOWN ||
event->key.key == SDLK_DOWN ) {
@@ -106,16 +106,16 @@ ErrorContext *gamepad_handle_button_down(void *appstate, SDL_Event *event)
SUCCEED_RETURN(errctx);
}
ErrorContext *gamepad_handle_button_up(void *appstate, SDL_Event *event)
akerr_ErrorContext *gamepad_handle_button_up(void *appstate, SDL_Event *event)
{
actor *player = NULL;
PREPARE_ERROR(errctx);
FAIL_ZERO_RETURN(errctx, appstate, ERR_NULLPOINTER, "NULL appstate");
FAIL_ZERO_RETURN(errctx, appstate, ERR_NULLPOINTER, "NULL event");
FAIL_ZERO_RETURN(errctx, appstate, AKERR_NULLPOINTER, "NULL appstate");
FAIL_ZERO_RETURN(errctx, appstate, AKERR_NULLPOINTER, "NULL event");
player = SDL_GetPointerProperty(REGISTRY_ACTOR, "player", NULL);
FAIL_ZERO_RETURN(errctx, appstate, ERR_NULLPOINTER, "Player actor does not exist");
FAIL_ZERO_RETURN(errctx, appstate, AKERR_NULLPOINTER, "Player actor does not exist");
if ( event->gbutton.button == SDL_GAMEPAD_BUTTON_DPAD_DOWN ||
event->key.key == SDLK_DOWN ) {
@@ -145,15 +145,15 @@ ErrorContext *gamepad_handle_button_up(void *appstate, SDL_Event *event)
SUCCEED_RETURN(errctx);
}
ErrorContext *gamepad_handle_added(void *appstate, SDL_Event *event)
akerr_ErrorContext *gamepad_handle_added(void *appstate, SDL_Event *event)
{
SDL_JoystickID which;
SDL_Gamepad *gamepad = NULL;
char *mapping = NULL;
PREPARE_ERROR(errctx);
FAIL_ZERO_RETURN(errctx, appstate, ERR_NULLPOINTER, "NULL appstate");
FAIL_ZERO_RETURN(errctx, appstate, ERR_NULLPOINTER, "NULL event");
FAIL_ZERO_RETURN(errctx, appstate, AKERR_NULLPOINTER, "NULL appstate");
FAIL_ZERO_RETURN(errctx, appstate, AKERR_NULLPOINTER, "NULL event");
which = event->gbutton.which;
gamepad = SDL_GetGamepadFromID(which);
@@ -175,14 +175,14 @@ ErrorContext *gamepad_handle_added(void *appstate, SDL_Event *event)
SUCCEED_RETURN(errctx);
}
ErrorContext *gamepad_handle_removed(void *appstate, SDL_Event *event)
akerr_ErrorContext *gamepad_handle_removed(void *appstate, SDL_Event *event)
{
SDL_JoystickID which;
SDL_Gamepad *gamepad = NULL;
PREPARE_ERROR(errctx);
FAIL_ZERO_RETURN(errctx, appstate, ERR_NULLPOINTER, "NULL appstate");
FAIL_ZERO_RETURN(errctx, appstate, ERR_NULLPOINTER, "NULL event");
FAIL_ZERO_RETURN(errctx, appstate, AKERR_NULLPOINTER, "NULL appstate");
FAIL_ZERO_RETURN(errctx, appstate, AKERR_NULLPOINTER, "NULL event");
which = event->gbutton.which;
gamepad = SDL_GetGamepadFromID(which);
@@ -194,7 +194,7 @@ ErrorContext *gamepad_handle_removed(void *appstate, SDL_Event *event)
SUCCEED_RETURN(errctx);
}
ErrorContext ERROR_NOIGNORE *SDL3G_controller_default(int controlmapid, char *actorname, int kbid, int jsid)
akerr_ErrorContext AKERR_NOIGNORE *SDL3G_controller_default(int controlmapid, char *actorname, int kbid, int jsid)
{
SDL3GControlMap *controlmap;
PREPARE_ERROR(errctx);
@@ -205,7 +205,7 @@ ErrorContext ERROR_NOIGNORE *SDL3G_controller_default(int controlmapid, char *ac
controlmap->jsid = jsid;
controlmap->target = SDL_GetPointerProperty(REGISTRY_ACTOR, actorname, NULL);
FAIL_ZERO_BREAK(errctx, controlmap->target, ERR_REGISTRY, "Actor %s not found in registry", actorname);
FAIL_ZERO_BREAK(errctx, controlmap->target, AKERR_REGISTRY, "Actor %s not found in registry", actorname);
// ---- KEYBOARD CONTROLS ----