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

@@ -16,6 +16,7 @@
#include <sdl3game/sprite.h>
#include <sdl3game/actor.h>
#include <sdl3game/registry.h>
#include <sdl3game/error.h>
#include <unistd.h>
@@ -41,8 +42,8 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
ATTEMPT {
FAIL_ZERO_BREAK(errctx, appstate, ERR_NULLPOINTER, "NULL appstate pointer");
FAIL_ZERO_BREAK(errctx, getcwd((char *)&cwdbuf, 1024), ERR_NULLPOINTER, "Couldn't get current working directory");
FAIL_ZERO_BREAK(errctx, appstate, AKERR_NULLPOINTER, "NULL appstate pointer");
FAIL_ZERO_BREAK(errctx, getcwd((char *)&cwdbuf, 1024), AKERR_NULLPOINTER, "Couldn't get current working directory");
strcpy((char *)&game.name, "charviewer");
strcpy((char *)&game.version, "0.0.1");
@@ -93,7 +94,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
REGISTRY_CHARACTER,
"little guy",
NULL);
FAIL_ZERO_BREAK(errctx, actorptr->basechar, ERR_REGISTRY, "Can't load character 'little guy' from the registry");
FAIL_ZERO_BREAK(errctx, actorptr->basechar, AKERR_REGISTRY, "Can't load character 'little guy' from the registry");
actorptr->movement_controls_face = false;
actorptr->state = (ACTOR_STATE_ALIVE | ACTOR_STATE_FACE_DOWN);
actorptr->x = 320;
@@ -101,9 +102,9 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
actorptr->visible = true;
// Open the first gamepad
FAIL_ZERO_BREAK(errctx, SDL_GetGamepads((int *)&gamepadids), ERR_SDL, "%s", SDL_GetError());
FAIL_ZERO_BREAK(errctx, SDL_GetGamepads((int *)&gamepadids), AKERR_SDL, "%s", SDL_GetError());
SDL_Log("Opening gamepad %d", gamepadids[0]);
FAIL_ZERO_BREAK(errctx, SDL_OpenGamepad(gamepadids[0]), ERR_SDL, "%s", SDL_GetError());
FAIL_ZERO_BREAK(errctx, SDL_OpenGamepad(gamepadids[0]), AKERR_SDL, "%s", SDL_GetError());
CATCH(errctx, SDL3G_controller_default(0, "player", 0, gamepadids[0]));
} CLEANUP {
@@ -121,8 +122,8 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
PREPARE_ERROR(errctx);
ATTEMPT {
FAIL_ZERO_BREAK(errctx, appstate, ERR_NULLPOINTER, "NULL appstate pointer");
FAIL_ZERO_BREAK(errctx, event, ERR_NULLPOINTER, "NULL event pointer");
FAIL_ZERO_BREAK(errctx, appstate, AKERR_NULLPOINTER, "NULL appstate pointer");
FAIL_ZERO_BREAK(errctx, event, AKERR_NULLPOINTER, "NULL event pointer");
CATCH(errctx, controller_handle_event(appstate, event));
if (event->type == SDL_EVENT_QUIT) {