aboutsummaryrefslogtreecommitdiff
path: root/animation.c
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-09-30 19:01:53 +1000
committerquou <quou@disroot.org>2024-09-30 19:01:53 +1000
commit7664fdafb9a6d6f4aa3339fe38958b24b234218e (patch)
treea1b1879403eab088aee66c091e476d407fe35402 /animation.c
parent98322a86ec78f732a5a6750a1e93061269cc76a7 (diff)
player slashing
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;
}