diff options
Diffstat (limited to 'animation.c')
-rw-r--r-- | animation.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/animation.c b/animation.c new file mode 100644 index 0000000..388e29d --- /dev/null +++ b/animation.c @@ -0,0 +1,9 @@ +#include "animation.h" +#include "rect.h" + +void update_anim(const Animation* a, int* f, Rect* r) { + f[0]++; + if (f[0] >= a->fc * a->s) + f[0] = 0; + *r = ((const Rect*)&a[1])[f[0] / a->s]; +} |