mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-03-04 09:11:27 +01:00
timeline: add TM_CleanQueue and TM_CleanBackgroundQueue functions
This commit is contained in:
parent
937981a1df
commit
25dcae6151
2 changed files with 17 additions and 3 deletions
|
@ -290,8 +290,8 @@ void TM_AddDelay(struct Timeline* timeline, int delay) {
|
|||
al_register_event_source(timeline->game->_priv.event_queue, al_get_timer_event_source(tmp->timer));
|
||||
}
|
||||
|
||||
void TM_Destroy(struct Timeline* timeline) {
|
||||
PrintConsole(timeline->game, "Timeline Manager[%s]: destroy", timeline->name);
|
||||
void TM_CleanQueue(struct Timeline* timeline) {
|
||||
PrintConsole(timeline->game, "Timeline Manager[%s]: cleaning queue", timeline->name);
|
||||
struct TM_Action *tmp, *tmp2, *pom = timeline->queue;
|
||||
tmp = NULL;
|
||||
while (pom!=NULL) {
|
||||
|
@ -316,6 +316,11 @@ void TM_Destroy(struct Timeline* timeline) {
|
|||
tmp = tmp2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TM_CleanBackgroundQueue(struct Timeline* timeline) {
|
||||
PrintConsole(timeline->game, "Timeline Manager[%s]: cleaning background queue", timeline->name);
|
||||
struct TM_Action *tmp, *tmp2, *pom = timeline->queue;
|
||||
tmp = NULL;
|
||||
pom=timeline->background;
|
||||
while (pom!=NULL) {
|
||||
|
@ -340,7 +345,12 @@ void TM_Destroy(struct Timeline* timeline) {
|
|||
tmp = tmp2;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void TM_Destroy(struct Timeline* timeline) {
|
||||
TM_CleanQueue(timeline);
|
||||
TM_CleanBackgroundQueue(timeline);
|
||||
PrintConsole(timeline->game, "Timeline Manager[%s]: destroy", timeline->name);
|
||||
free(timeline->name);
|
||||
free(timeline);
|
||||
}
|
||||
|
|
|
@ -84,6 +84,10 @@ struct TM_Action* TM_AddBackgroundAction(struct Timeline*, bool (*func)(struct G
|
|||
struct TM_Action* TM_AddQueuedBackgroundAction(struct Timeline*, bool (*func)(struct Game*, struct TM_Action*, enum TM_ActionState), struct TM_Arguments* args, int delay, char* name);
|
||||
/*! \brief Add delay to main queue. */
|
||||
void TM_AddDelay(struct Timeline*, int delay);
|
||||
/*! \brief Remove all actions from main queue. */
|
||||
void TM_CleanQueue(struct Timeline*);
|
||||
/*! \brief Remove all actions from background queue. */
|
||||
void TM_CleanBackgroundQueue(struct Timeline*);
|
||||
/*! \brief Destroy timeline. */
|
||||
void TM_Destroy(struct Timeline*);
|
||||
/*! \brief Add data to TM_Arguments queue. */
|
||||
|
|
Loading…
Add table
Reference in a new issue