aboutsummaryrefslogtreecommitdiff
path: root/animation.c
diff options
context:
space:
mode:
Diffstat (limited to 'animation.c')
-rw-r--r--animation.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/animation.c b/animation.c
index 388e29d..2010301 100644
--- a/animation.c
+++ b/animation.c
@@ -1,9 +1,13 @@
#include "animation.h"
#include "rect.h"
-void update_anim(const Animation* a, int* f, Rect* r) {
+int update_anim(const Animation* a, int* f, Rect* r) {
+ int done = 0;
f[0]++;
- if (f[0] >= a->fc * a->s)
+ if (f[0] >= a->fc * a->s) {
f[0] = 0;
+ done = 1;
+ }
*r = ((const Rect*)&a[1])[f[0] / a->s];
+ return done;
}