mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-14 17:04:22 +01:00
Timeline Manager: run next action in main queue immediatelly after the last one ended
This commit is contained in:
parent
9c414991dd
commit
655cce6abe
1 changed files with 37 additions and 28 deletions
|
@ -36,7 +36,10 @@ SYMBOL_EXPORT struct Timeline* TM_Init(struct Game* g, char* name) {
|
||||||
|
|
||||||
SYMBOL_EXPORT void TM_Process(struct Timeline* timeline) {
|
SYMBOL_EXPORT void TM_Process(struct Timeline* timeline) {
|
||||||
/* process first element from queue
|
/* process first element from queue
|
||||||
if returns true, delete it */
|
if returns true, delete it
|
||||||
|
and repeat for the next one */
|
||||||
|
bool next = true;
|
||||||
|
while (next) {
|
||||||
if (timeline->queue) {
|
if (timeline->queue) {
|
||||||
if (*timeline->queue->function) {
|
if (*timeline->queue->function) {
|
||||||
if (!timeline->queue->active) {
|
if (!timeline->queue->active) {
|
||||||
|
@ -53,6 +56,8 @@ SYMBOL_EXPORT void TM_Process(struct Timeline* timeline) {
|
||||||
TM_DestroyArgs(tmp->arguments);
|
TM_DestroyArgs(tmp->arguments);
|
||||||
free(tmp->name);
|
free(tmp->name);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
} else {
|
||||||
|
next = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* delay handling */
|
/* delay handling */
|
||||||
|
@ -66,8 +71,12 @@ SYMBOL_EXPORT void TM_Process(struct Timeline* timeline) {
|
||||||
PrintConsole(timeline->game, "Timeline Manager[%s]: queue: delay started %d ms (%d - %s)", timeline->name, timeline->queue->delay, timeline->queue->id, timeline->queue->name);
|
PrintConsole(timeline->game, "Timeline Manager[%s]: queue: delay started %d ms (%d - %s)", timeline->name, timeline->queue->delay, timeline->queue->id, timeline->queue->name);
|
||||||
al_start_timer(timeline->queue->timer);
|
al_start_timer(timeline->queue->timer);
|
||||||
}
|
}
|
||||||
|
next = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
next = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* process all elements from background marked as active */
|
/* process all elements from background marked as active */
|
||||||
struct TM_Action *tmp, *tmp2, *pom = timeline->background;
|
struct TM_Action *tmp, *tmp2, *pom = timeline->background;
|
||||||
|
|
Loading…
Reference in a new issue