summaryrefslogtreecommitdiff
path: root/AnimationObject.c
diff options
context:
space:
mode:
Diffstat (limited to 'AnimationObject.c')
-rw-r--r--AnimationObject.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/AnimationObject.c b/AnimationObject.c
index 16489c3..87fe324 100644
--- a/AnimationObject.c
+++ b/AnimationObject.c
@@ -1,5 +1,6 @@
#include "AnimationObject.h"
#include <math.h>
+#include <stdlib.h>
ARGB
AO_CheckerPattern(const Animation* anim, u32 frameIndex, ARGB pixel, i32 r, i32 c, void* priv) {
@@ -64,3 +65,14 @@ AO_Line(const Animation* anim, u32 frameIndex, ARGB pixel, i32 r, i32 c, void* p
return pixel;
}
+
+ARGB
+AO_HorSegment(const Animation* anim, u32 frameIndex, ARGB pixel, i32 r, i32 c, void* priv) {
+ struct AO_HorSegment hs = *(struct AO_HorSegment*)priv;
+
+ if (abs(r) <= hs.width && hs.left <= c && c <= hs.right) {
+ ARGB_set(&pixel, hs.color);
+ }
+
+ return pixel;
+}