summaryrefslogtreecommitdiff
path: root/AnimationObject.c
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2026-03-16 20:59:04 +0200
committerSyndamia <kamen@syndamia.com>2026-03-16 20:59:04 +0200
commitef4a2773e90ebc6ed7ad66bcfd4e30165c04fb93 (patch)
treef2ee90c08ae5f11692bd6c3ccf85077aab465e6b /AnimationObject.c
parent2202e87c466803eeaddd974006aa9950d8e0d067 (diff)
downloadppm_graphics-ef4a2773e90ebc6ed7ad66bcfd4e30165c04fb93.tar
ppm_graphics-ef4a2773e90ebc6ed7ad66bcfd4e30165c04fb93.tar.gz
ppm_graphics-ef4a2773e90ebc6ed7ad66bcfd4e30165c04fb93.zip
feat: Implement circle and rename square
Diffstat (limited to 'AnimationObject.c')
-rw-r--r--AnimationObject.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/AnimationObject.c b/AnimationObject.c
index af3798b..16489c3 100644
--- a/AnimationObject.c
+++ b/AnimationObject.c
@@ -20,7 +20,7 @@ AO_CheckerPattern(const Animation* anim, u32 frameIndex, ARGB pixel, i32 r, i32
ARGB
AO_Square(const Animation* anim, u32 frameIndex, ARGB pixel, i32 r, i32 c, void* priv) {
- struct AO_SquareSettings* set = (struct AO_SquareSettings*)priv;
+ struct AO_Square* set = (struct AO_Square*)priv;
if (0 <= r && r <= set->width && 0 <= c && c <= set->height) {
ARGB_set(&pixel, set->color);
@@ -30,6 +30,17 @@ AO_Square(const Animation* anim, u32 frameIndex, ARGB pixel, i32 r, i32 c, void*
}
ARGB
+AO_Circle(const Animation* anim, u32 frameIndex, ARGB pixel, i32 r, i32 c, void* priv) {
+ struct AO_Circle* cir = (struct AO_Circle*)priv;
+
+ if (r * r + c * c < cir->radius * cir->radius) {
+ ARGB_set(&pixel, cir->color);
+ }
+
+ return pixel;
+}
+
+ARGB
AO_Image(const Animation* anim, u32 frameIndex, ARGB pixel, i32 r, i32 c, void* priv) {
struct AO_Image img = *(struct AO_Image*)priv;