summaryrefslogtreecommitdiff
path: root/graphics.c
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2026-03-16 20:59:04 +0200
committerSyndamia <kamen@syndamia.com>2026-03-16 20:59:04 +0200
commit56099072165578b505a6c81e187cf392b9bd5a2e (patch)
tree3ead55a36ec5554ec5f8a01a1bc3797d275b6bb6 /graphics.c
parent3e9c46f82430d7bb609cebb57be17c26cba4acb5 (diff)
downloadppm_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 'graphics.c')
-rw-r--r--graphics.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/graphics.c b/graphics.c
index 97b07df..4ac5055 100644
--- a/graphics.c
+++ b/graphics.c
@@ -150,23 +150,17 @@ main() {
/* Move child node from right to left */
- childNode_moveToLeft.startFrame = segment_spin_moveToLeft.startFrame = segment_translate_moveToLeft.startFrame
- = anim.frameCount / 3 - FPS;
- childNode_moveToLeft.endFrame = segment_spin_moveToLeft.endFrame = segment_translate_moveToLeft.endFrame
- = anim.frameCount / 3;
- Animation_pushEvent(&anim, childNode_moveToLeft.startFrame, childNode_moveToLeft.endFrame, A_Interpolate, &childNode_moveToLeft);
- Animation_pushEvent(&anim, childNode_moveToLeft.startFrame, childNode_moveToLeft.endFrame, A_Interpolate, &segment_spin_moveToLeft);
- Animation_pushEvent(&anim, childNode_moveToLeft.startFrame, childNode_moveToLeft.endFrame, A_Interpolate, &segment_translate_moveToLeft);
+ u32 start = anim.frameCount / 3 - FPS, end = anim.frameCount / 3;
+ Animation_pushEvent(&anim, start, end, A_Interpolate, &childNode_moveToLeft);
+ Animation_pushEvent(&anim, start, end, A_Interpolate, &segment_spin_moveToLeft);
+ Animation_pushEvent(&anim, start, end, A_Interpolate, &segment_translate_moveToLeft);
/* Move child node from left to right */
- childNode_moveToRight.startFrame = segment_spin_moveToRight.startFrame = segment_translate_moveToRight.startFrame
- = anim.frameCount * 2 / 3 - FPS;
- childNode_moveToRight.endFrame = segment_spin_moveToRight.endFrame = segment_translate_moveToRight.endFrame
- = anim.frameCount * 2 / 3;
- Animation_pushEvent(&anim, childNode_moveToRight.startFrame, childNode_moveToRight.endFrame, A_Interpolate, &childNode_moveToRight);
- Animation_pushEvent(&anim, childNode_moveToRight.startFrame, childNode_moveToRight.endFrame, A_Interpolate, &segment_spin_moveToRight);
- Animation_pushEvent(&anim, childNode_moveToRight.startFrame, childNode_moveToRight.endFrame, A_Interpolate, &segment_translate_moveToRight);
+ start = anim.frameCount * 2 / 3 - FPS, end = anim.frameCount * 2 / 3;
+ Animation_pushEvent(&anim, start, end, A_Interpolate, &childNode_moveToRight);
+ Animation_pushEvent(&anim, start, end, A_Interpolate, &segment_spin_moveToRight);
+ Animation_pushEvent(&anim, start, end, A_Interpolate, &segment_translate_moveToRight);
Animation_render(&anim);