2D_Engine_Casio/src/ecs/animation_system.h

34 lines
774 B
C

#ifndef ANIMATION_SYSTEM_H
#define ANIMATION_SYSTEM_H
#include "ecs.h"
#include "sprite_component.h"
typedef struct animation_system_data_t {
sprite_component_data_t *sprite_component_data;
bool play :1;
bool loop :1;
bool reverse :1;
float frame_delay_ms;
float frame_timer_ms;
elem_t *actual_frame;
size_t actual_frame_nb;
size_t nb_frames;
linked_list_t frames;
} animation_system_data_t;
void animation_system_init(component_t *, va_list);
void animation_system_update(component_t *);
void animation_system_destroy(component_t *);
void animation_system_create_frames_clips(animation_system_data_t *);
void animation_system_change_animation(animation_system_data_t *, const char *, size_t);
#endif // SPRITE_COMPONENT_H