#include "img_seq.h"
#include "aliases/aliases.h"

img_seq_t *create_sequence(u64 frame_count) {
  return (img_seq_t *)malloc(
      (sizeof(img_seq_t) + frame_count * sizeof(SDL_Texture *)));
}

SDL_Texture *current_frame(img_seq_t *seq) { return seq->frames[seq->pos]; }

void next_frame(img_seq_t *seq) {
  ++(seq->pos);

  if (seq->pos >= seq->length) {
    seq->pos = 0;
  }
}
