// sprites.h
#pragma once

#include "lib.h"
#include "include/raylib.h"

typedef struct {
    Texture2D texture;
    char *name;
    Size size;
} SpriteSheet;

typedef struct {
    char* name;
    u8 total_frames;
    bool loop;
    Rectangle src_rect;
} SpriteAnimation;

typedef struct {
    u16 anim_id;
    u8 current_frame;
    bool is_finished;
    f32 time_elapsed;
} SpriteAnimationPlayback;

void PlayAnimation(SpriteAnimationPlayback *playbacks, SpriteAnimationPlayback playback);
void TickSpriteAnimations(const SpriteAnimation *animations, SpriteAnimationPlayback *playbacks, int len);
