use al_resume_timer where appropriate

This commit is contained in:
Sebastian Krzyszkowiak 2016-08-21 21:58:47 +02:00
parent b927a0c130
commit 39eeeb44fd
3 changed files with 8 additions and 8 deletions

View file

@ -28,9 +28,6 @@
#include <dlfcn.h>
#include <unistd.h>
#include <libgen.h>
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_acodec.h>
#include <allegro5/allegro_ttf.h>
#ifdef ALLEGRO_MACOSX
#include <mach-o/dyld.h>
#include <sys/param.h>
@ -270,7 +267,7 @@ SYMBOL_EXPORT int libsuperderpy_run(struct Game *game) {
tmp->pending_unload = false;
game->_priv.current_gamestate = tmp;
(*tmp->api->Gamestate_Unload)(game, tmp->data);
al_start_timer(game->_priv.timer);
al_resume_timer(game->_priv.timer);
}
if (tmp->pending_load) {
al_stop_timer(game->_priv.timer);
@ -328,7 +325,7 @@ SYMBOL_EXPORT int libsuperderpy_run(struct Game *game) {
tmp->loaded = true;
tmp->pending_load = false;
}
al_start_timer(game->_priv.timer);
al_resume_timer(game->_priv.timer);
}
tmp=tmp->next;
@ -343,7 +340,7 @@ SYMBOL_EXPORT int libsuperderpy_run(struct Game *game) {
al_stop_timer(game->_priv.timer);
game->_priv.current_gamestate = tmp;
(*tmp->api->Gamestate_Start)(game, tmp->data);
al_start_timer(game->_priv.timer);
al_resume_timer(game->_priv.timer);
tmp->started = true;
tmp->pending_start = false;
}

View file

@ -27,6 +27,9 @@
#include <allegro5/allegro_audio.h>
#include <allegro5/allegro_image.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_acodec.h>
#include <allegro5/allegro_ttf.h>
#include "gamestate.h"
#include "config.h"
#include "timeline.h"

View file

@ -124,7 +124,7 @@ SYMBOL_INTERNAL void PauseTimers(struct Timeline* timeline, bool pause) {
if (timeline->queue->timer) {
if (pause) {
al_stop_timer(timeline->queue->timer);
} else if (!timeline->queue->active) al_start_timer(timeline->queue->timer);
} else if (!timeline->queue->active) al_resume_timer(timeline->queue->timer);
}
}
struct TM_Action* tmp = timeline->background;
@ -132,7 +132,7 @@ SYMBOL_INTERNAL void PauseTimers(struct Timeline* timeline, bool pause) {
if (tmp->timer) {
if (pause) {
al_stop_timer(tmp->timer);
} else if (!tmp->active) al_start_timer(tmp->timer);
} else if (!tmp->active) al_resume_timer(tmp->timer);
}
tmp = tmp->next;
}