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 --- AnimationInterpolate.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'AnimationInterpolate.c') diff --git a/AnimationInterpolate.c b/AnimationInterpolate.c index 37a0990..44bdafc 100644 --- a/AnimationInterpolate.c +++ b/AnimationInterpolate.c @@ -20,26 +20,26 @@ colorInterpolate(color ina, color inb, double percentage) { } ARGB -A_Interpolate(const Animation* anim, u32 frameIndex, ARGB pixel, i32 r, i32 c, void* value) { - struct A_Interpolate in = *(struct A_Interpolate*)value; +A_Interpolate(const Animation* anim, PixelRendererParams a) { + struct A_Interpolate in = *(struct A_Interpolate*)a.priv; if (in.interpolate == NULL) { fprintf(stderr, "Interpolation function cannot be NULL!\n"); - ARGB_set(&pixel, 0xFFFF00FF); - return pixel; + ARGB_set(&a.pixel, 0xFFFF00FF); + return a.pixel; } - if (frameIndex == in.startFrame) { + if (a.frame.current == in.startFrame) { memcpy(in.initialValueTemp, in.value, in.initialValueTempSize); } - double perc = (double)(frameIndex - in.startFrame) / (in.endFrame - in.startFrame); + double perc = (double)(a.frame.current - in.startFrame) / (in.endFrame - in.startFrame); if (perc < 0.0) perc = 0.0; if (perc > 1.0) perc = 1.0; in.interpolate(in.value, in.initialValueTemp, in.goalValue, perc); - return pixel; + return a.pixel; } void -- cgit v1.2.3