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 | 56099072165578b505a6c81e187cf392b9bd5a2e (patch) | |
| tree | 3ead55a36ec5554ec5f8a01a1bc3797d275b6bb6 /AnimationInterpolate.c | |
| parent | 3e9c46f82430d7bb609cebb57be17c26cba4acb5 (diff) | |
| download | ppm_graphics-56099072165578b505a6c81e187cf392b9bd5a2e.tar ppm_graphics-56099072165578b505a6c81e187cf392b9bd5a2e.tar.gz ppm_graphics-56099072165578b505a6c81e187cf392b9bd5a2e.zip | |
fix: Rework interpolation to use newly introduced start and end frame timesv0.1
Diffstat (limited to 'AnimationInterpolate.c')
| -rw-r--r-- | AnimationInterpolate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/AnimationInterpolate.c b/AnimationInterpolate.c index 44bdafc..a84b5a2 100644 --- a/AnimationInterpolate.c +++ b/AnimationInterpolate.c @@ -29,11 +29,11 @@ A_Interpolate(const Animation* anim, PixelRendererParams a) { return a.pixel; } - if (a.frame.current == in.startFrame) { + if (a.frame.current == a.frame.start) { memcpy(in.initialValueTemp, in.value, in.initialValueTempSize); } - double perc = (double)(a.frame.current - in.startFrame) / (in.endFrame - in.startFrame); + double perc = (double)(a.frame.current - a.frame.start) / (a.frame.end - a.frame.start); if (perc < 0.0) perc = 0.0; if (perc > 1.0) perc = 1.0; |
