From 52883755f19757c16623b93b6ae8f44e04330e91 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Wed, 30 May 2018 00:30:12 +0200 Subject: [PATCH] timeline: initial API change for handling time delta --- src/timeline.c | 3 ++- src/timeline.h | 2 +- src/tween.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/timeline.c b/src/timeline.c index ddcfc4e..83ffdf8 100644 --- a/src/timeline.c +++ b/src/timeline.c @@ -34,7 +34,8 @@ SYMBOL_EXPORT struct Timeline* TM_Init(struct Game* game, char* name) { return timeline; } -SYMBOL_EXPORT void TM_Process(struct Timeline* timeline) { +SYMBOL_EXPORT void TM_Process(struct Timeline* timeline, double delta) { + // TODO: handle delta /* process first element from queue if returns true, delete it and repeat for the next one */ diff --git a/src/timeline.h b/src/timeline.h index 0cfc360..0111f68 100644 --- a/src/timeline.h +++ b/src/timeline.h @@ -68,7 +68,7 @@ struct TM_Action { /*! \brief Init timeline. */ struct Timeline* TM_Init(struct Game* game, char* name); /*! \brief Process current timeline actions. */ -void TM_Process(struct Timeline*); +void TM_Process(struct Timeline*, double delta); /*! \brief Ask current timeline actions to draw. */ void TM_Draw(struct Timeline*); /*! \brief Pauses the timeline. */ diff --git a/src/tween.c b/src/tween.c index c9a3d59..762766c 100644 --- a/src/tween.c +++ b/src/tween.c @@ -335,6 +335,7 @@ double Interpolate(double pos, TWEEN_STYLE style) { case TWEEN_STYLE_BOUNCE_IN_OUT: return BounceEaseInOut(pos); } + return pos; } double GetTweenInterpolation(struct Tween* tween) {