diff options
| author | Syndamia <kamen@syndamia.com> | 2026-03-16 20:59:04 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2026-03-16 20:59:04 +0200 |
| commit | 3e9c46f82430d7bb609cebb57be17c26cba4acb5 (patch) | |
| tree | 5b03be91eb637b2ce7fb37ac2c67319d0978dbf8 /Animation.h | |
| parent | e6842e44159d7cc9b1c32dd2baae4df164fa81d2 (diff) | |
| download | ppm_graphics-3e9c46f82430d7bb609cebb57be17c26cba4acb5.tar ppm_graphics-3e9c46f82430d7bb609cebb57be17c26cba4acb5.tar.gz ppm_graphics-3e9c46f82430d7bb609cebb57be17c26cba4acb5.zip | |
chore: Rework renderer functions to use a struct instead of different arguments
Diffstat (limited to 'Animation.h')
| -rw-r--r-- | Animation.h | 17 |
1 files changed, 16 insertions, 1 deletions
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); |
