diff options
Diffstat (limited to 'AnimationInterpolate.c')
| -rw-r--r-- | AnimationInterpolate.c | 14 |
1 files changed, 7 insertions, 7 deletions
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 |
