From f99ea1e74c2979b9970aee265f8a5ac9b167e42a Mon Sep 17 00:00:00 2001 From: Forest Belton Date: Thu, 30 Sep 2021 17:56:08 -0400 Subject: [PATCH] Compute animation offset --- src/actor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/actor.c b/src/actor.c index affc728..f332764 100644 --- a/src/actor.c +++ b/src/actor.c @@ -15,6 +15,7 @@ #define PLAYER_ACTOR_IDX 0 static actor_anim_state_t ANIM_TOTAL_FRAMES[] = {2, 1}; +static uint8_t ANIM_OFFSETS[] = {0, 2 * 4}; static uint8_t mob_ids[MAX_UNIQUE_MOBS]; static uint8_t *mob_anim_data[MAX_UNIQUE_MOBS]; @@ -90,7 +91,7 @@ void actor_update(void) { const uint8_t *anim_ptr; if (i == 0) { - anim_ptr = &player_map[0]; + anim_ptr = &player_map[ANIM_OFFSETS[a->anim]]; } else { anim_ptr = mob_anim_data[a->mob_anim_idx]; }