summaryrefslogtreecommitdiff
path: root/graphics.c
diff options
context:
space:
mode:
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);