Fixed a bug in reference counting on the heap objects. Added multiple sprites to a character.
This commit is contained in:
@@ -66,6 +66,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
|
||||
TRY {
|
||||
sprite_load_json("../assets/sprites/little_guy_walking_left.json");
|
||||
sprite_load_json("../assets/sprites/little_guy_facing_left.json");
|
||||
character_load_json("../assets/characters/littleguy.json");
|
||||
|
||||
actorptr = heap_next_actor();
|
||||
@@ -74,9 +75,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
|
||||
REGISTRY_CHARACTER,
|
||||
"little guy",
|
||||
NULL);
|
||||
actorptr->x = 0;
|
||||
actorptr->y = 0;
|
||||
actorptr->state = (ACTOR_STATE_ALIVE | ACTOR_STATE_FACE_LEFT | ACTOR_STATE_MOVING_LEFT);
|
||||
actorptr->state = (ACTOR_STATE_ALIVE | ACTOR_STATE_FACE_LEFT);
|
||||
} CATCH(EXC_NULLPOINTER) {
|
||||
SDL_Log("Attempting to load asset: %s (%s)", EXCLIB_EXCEPTION->description, SDL_GetError());
|
||||
return SDL_APP_FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user