From 3e9c46f82430d7bb609cebb57be17c26cba4acb5 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 16 Mar 2026 20:59:04 +0200 Subject: chore: Rework renderer functions to use a struct instead of different arguments --- Animation.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'Animation.h') diff --git a/Animation.h b/Animation.h index 96fa765..6cebdb0 100644 --- a/Animation.h +++ b/Animation.h @@ -16,7 +16,22 @@ typedef struct Animation { AnimationEventNode* events; } Animation; -typedef ARGB (*PixelRenderer)(const Animation* anim, u32 currentFrame, ARGB pixel, i32 row, i32 col, void* priv); +typedef struct PixelRendererParams { + struct Frames { + u32 current; + u32 start; + u32 end; + } frame; + + ARGB pixel; + + i32 row; + i32 col; + + void* priv; +} PixelRendererParams; + +typedef ARGB (*PixelRenderer)(const Animation* anim, PixelRendererParams params); AnimationEventNode* AnimationEventNode_new(u32 startFrame, u32 endFrame, PixelRenderer renderCallback, void* privateData); Animation Animation_new(u32 width, u32 height, u32 frameCount); -- cgit v1.2.3