Browse Source

Compute animation offset

master
Forest Belton 3 years ago
parent
commit
f99ea1e74c
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/actor.c

+ 2
- 1
src/actor.c View File

@ -15,6 +15,7 @@
#define PLAYER_ACTOR_IDX 0 #define PLAYER_ACTOR_IDX 0
static actor_anim_state_t ANIM_TOTAL_FRAMES[] = {2, 1}; 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_ids[MAX_UNIQUE_MOBS];
static uint8_t *mob_anim_data[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; const uint8_t *anim_ptr;
if (i == 0) { if (i == 0) {
anim_ptr = &player_map[0];
anim_ptr = &player_map[ANIM_OFFSETS[a->anim]];
} else { } else {
anim_ptr = mob_anim_data[a->mob_anim_idx]; anim_ptr = mob_anim_data[a->mob_anim_idx];
} }

Loading…
Cancel
Save