diff --git a/src/timeline.c b/src/timeline.c index bbde5e5..50c7fa1 100644 --- a/src/timeline.c +++ b/src/timeline.c @@ -341,6 +341,21 @@ SYMBOL_EXPORT void TM_CleanBackgroundQueue(struct Timeline* timeline) { timeline->background = NULL; } +SYMBOL_EXPORT void TM_SkipDelay(struct Timeline* timeline) { + if (timeline->queue && timeline->queue->timer) { + al_stop_timer(timeline->queue->timer); + al_set_timer_speed(timeline->queue->timer, 0.01); + al_start_timer(timeline->queue->timer); + } +} + +SYMBOL_EXPORT bool TM_IsEmpty(struct Timeline* timeline) { + return !timeline->queue; +} +SYMBOL_EXPORT bool TM_IsBackgroundEmpty(struct Timeline* timeline) { + return !timeline->background; +} + SYMBOL_EXPORT void TM_Destroy(struct Timeline* timeline) { TM_CleanQueue(timeline); TM_CleanBackgroundQueue(timeline); diff --git a/src/timeline.h b/src/timeline.h index 266c356..e27ecbe 100644 --- a/src/timeline.h +++ b/src/timeline.h @@ -96,5 +96,11 @@ struct TM_Arguments* TM_AddToArgs(struct TM_Arguments* args, int num, ...); void* TM_GetArg(struct TM_Arguments *args, int num); /*! \brief Destroy TM_Arguments queue. */ void TM_DestroyArgs(struct TM_Arguments* args); +/*! \brief Skip delay if it's currently the first action in the queue */ +void TM_SkipDelay(struct Timeline*); +/*! \brief Checks if the main queue is empty */ +bool TM_IsEmpty(struct Timeline* timeline); +/*! \brief Checks if the background queue is empty */ +bool TM_IsBackgroundEmpty(struct Timeline* timeline); #endif