animation.h 617 B

1234567891011121314151617181920212223242526272829303132
  1. /**
  2. *** :: Animation ::
  3. ***
  4. *** Contains an array of frames and frame times.
  5. ***
  6. **/
  7. #ifndef animation_h
  8. #define animation_h
  9. #include "skeleton.h"
  10. typedef struct {
  11. int frame_count;
  12. float frame_time;
  13. frame** frames;
  14. } animation;
  15. animation* animation_new();
  16. void animation_delete(animation* a);
  17. float animation_duration(animation* a);
  18. frame* animation_add_frame(animation* a, frame* base);
  19. frame* animation_frame(animation* a, int i);
  20. frame* animation_sample(animation* a, float time);
  21. void animation_sample_to(animation* a, float time, frame* out);
  22. animation* ani_load_file(char* filename);
  23. #endif