Game rebuilds against latest libsdl3game

This commit is contained in:
2026-05-04 00:18:55 -04:00
parent 2028065b84
commit e95b907ba9
7 changed files with 14 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
SDLFLAGS_CC:=$(shell pkg-config sdl3 --cflags) SDLFLAGS_CC:=$(shell pkg-config sdl3 --cflags) $(shell pkg-config sdl3-image --cflags) $(shell pkg-config sdl3game --clfags) $(shell pkg-config akerror --cflags)
SDLFLAGS_LD:=$(shell pkg-config sdl3 --libs) $(shell pkg-config sdl3-mixer --libs) $(shell pkg-config sdl3-image --libs) -lasound SDLFLAGS_LD:=$(shell pkg-config sdl3 --libs) $(shell pkg-config sdl3-mixer --libs) $(shell pkg-config sdl3-image --libs) $(shell pkg-config sdl3game --libs) $(shell pkg-config akerror --libs) -lasound
CC:=$(shell which gcc) CC:=$(shell which gcc)
LD:=$(shell which ld) LD:=$(shell which ld)

View File

@@ -1,8 +1,8 @@
{ {
"name": "little guy", "name": "little guy",
"movementspeed": 1, "movementspeed": 30,
"velocity_x": 0.02, "velocity_x": 0.15,
"velocity_y": 0.02, "velocity_y": 0.15,
"sprite_mappings": [ "sprite_mappings": [
{ {
"state": [ "state": [

View File

@@ -7,7 +7,7 @@
"name": "little guy walking down", "name": "little guy walking down",
"width": 48, "width": 48,
"height": 48, "height": 48,
"speed": 1000, "speed": 300,
"loop": true, "loop": true,
"loopReverse": true, "loopReverse": true,
"frames": [ "frames": [

View File

@@ -7,7 +7,7 @@
"name": "little guy walking left", "name": "little guy walking left",
"width": 48, "width": 48,
"height": 48, "height": 48,
"speed": 1000, "speed": 300,
"loop": true, "loop": true,
"loopReverse": true, "loopReverse": true,
"frames": [ "frames": [

View File

@@ -7,7 +7,7 @@
"name": "little guy walking right", "name": "little guy walking right",
"width": 48, "width": 48,
"height": 48, "height": 48,
"speed": 1000, "speed": 300,
"loop": true, "loop": true,
"loopReverse": true, "loopReverse": true,
"frames": [ "frames": [

View File

@@ -7,7 +7,7 @@
"name": "little guy walking up", "name": "little guy walking up",
"width": 48, "width": 48,
"height": 48, "height": 48,
"speed": 1000, "speed": 300,
"loop": true, "loop": true,
"loopReverse": true, "loopReverse": true,
"frames": [ "frames": [

View File

@@ -5,7 +5,6 @@
#include <SDL3_image/SDL_image.h> #include <SDL3_image/SDL_image.h>
#include <SDL3_mixer/SDL_mixer.h> #include <SDL3_mixer/SDL_mixer.h>
#include <sdlerror.h>
#include <sdl3game/assets.h> #include <sdl3game/assets.h>
#include <sdl3game/iterator.h> #include <sdl3game/iterator.h>
#include <sdl3game/tilemap.h> #include <sdl3game/tilemap.h>
@@ -31,7 +30,7 @@ char *spritepaths[] = {
char dirnamebuf[1024]; char dirnamebuf[1024];
ErrorContext ERROR_NOIGNORE *user_breakpoint(actor *obj, SDL_Event *event) akerr_ErrorContext AKERR_NOIGNORE *user_breakpoint(actor *obj, SDL_Event *event)
{ {
PREPARE_ERROR(errctx); PREPARE_ERROR(errctx);
SDL_Log("User breakpoint hit"); SDL_Log("User breakpoint hit");
@@ -45,7 +44,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
*appstate = (void *)&game.state; *appstate = (void *)&game.state;
PREPARE_ERROR(errctx); PREPARE_ERROR(errctx);
ATTEMPT { ATTEMPT {
FAIL_ZERO_BREAK(errctx, appstate, ERR_NULLPOINTER, "NULL appstate pointer"); FAIL_ZERO_BREAK(errctx, appstate, AKERR_NULLPOINTER, "NULL appstate pointer");
strcpy((char *)&game.name, "sdl3-gametest"); strcpy((char *)&game.name, "sdl3-gametest");
strcpy((char *)&game.version, "0.0.1"); strcpy((char *)&game.version, "0.0.1");
@@ -67,7 +66,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
REGISTRY_CHARACTER, REGISTRY_CHARACTER,
"little guy", "little guy",
NULL); 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->movement_controls_face = false;
actorptr->state = (ACTOR_STATE_ALIVE | ACTOR_STATE_FACE_LEFT); actorptr->state = (ACTOR_STATE_ALIVE | ACTOR_STATE_FACE_LEFT);
actorptr->x = 320; actorptr->x = 320;
@@ -134,8 +133,8 @@ SDL_AppResult SDL_AppEvent(void *appstate, SDL_Event *event)
PREPARE_ERROR(errctx); PREPARE_ERROR(errctx);
ATTEMPT { ATTEMPT {
FAIL_ZERO_BREAK(errctx, appstate, ERR_NULLPOINTER, "NULL appstate pointer"); FAIL_ZERO_BREAK(errctx, appstate, AKERR_NULLPOINTER, "NULL appstate pointer");
FAIL_ZERO_BREAK(errctx, event, ERR_NULLPOINTER, "NULL event pointer"); FAIL_ZERO_BREAK(errctx, event, AKERR_NULLPOINTER, "NULL event pointer");
CATCH(errctx, controller_handle_event(appstate, event)); CATCH(errctx, controller_handle_event(appstate, event));
if (event->type == SDL_EVENT_QUIT) { if (event->type == SDL_EVENT_QUIT) {