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

@@ -27,14 +27,14 @@ MIX_Track *GAME_tracks[64];
SDL_FRect camera;
Game game;
ErrorContext ERROR_NOIGNORE *GAME_init()
akerr_ErrorContext AKERR_NOIGNORE *GAME_init()
{
int i = 0;
PREPARE_ERROR(errctx);
ATTEMPT {
FAIL_ZERO_BREAK(errctx, strlen((char *)&game.name), ERR_NULLPOINTER, "Must provide game name");
FAIL_ZERO_BREAK(errctx, strlen((char *)&game.version), ERR_NULLPOINTER, "Must provide game version");
FAIL_ZERO_BREAK(errctx, strlen((char *)&game.uri), ERR_NULLPOINTER, "Must provide game uri");
FAIL_ZERO_BREAK(errctx, strlen((char *)&game.name), AKERR_NULLPOINTER, "Must provide game name");
FAIL_ZERO_BREAK(errctx, strlen((char *)&game.version), AKERR_NULLPOINTER, "Must provide game version");
FAIL_ZERO_BREAK(errctx, strlen((char *)&game.uri), AKERR_NULLPOINTER, "Must provide game uri");
CATCH(errctx, heap_init());
CATCH(errctx, registry_init_actor());
CATCH(errctx, registry_init_sprite());
@@ -54,7 +54,7 @@ ErrorContext ERROR_NOIGNORE *GAME_init()
FAIL_ZERO_RETURN(
errctx,
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMEPAD | SDL_INIT_AUDIO),
ERR_SDL,
AKERR_SDL,
"Couldn't initialize SDL: %s",
SDL_GetError());
@@ -62,28 +62,28 @@ ErrorContext ERROR_NOIGNORE *GAME_init()
for ( i = 0; i < SDL_GAMECONTROLLER_DB_LEN ; i++ ) {
if ( SDL_AddGamepadMapping(SDL_GAMECONTROLLER_DB[i]) == -1 ) {
FAIL_ZERO_RETURN(errctx, 0, ERR_SDL, "%s", SDL_GetError());
FAIL_ZERO_RETURN(errctx, 0, AKERR_SDL, "%s", SDL_GetError());
}
}
FAIL_ZERO_RETURN(
errctx,
SDL_CreateWindowAndRenderer(game.uri, game.screenwidth, game.screenheight, 0, &window, &renderer),
ERR_SDL,
AKERR_SDL,
"Couldn't create window/renderer: %s",
SDL_GetError());
FAIL_ZERO_RETURN(
errctx,
MIX_Init(),
ERR_SDL,
AKERR_SDL,
"Couldn't initialize audio: %s",
SDL_GetError());
game.mixer = MIX_CreateMixerDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, 0);
FAIL_ZERO_RETURN(
errctx,
game.mixer,
ERR_SDL,
AKERR_SDL,
"Unable to create mixer device: %s",
SDL_GetError());