mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-12 16:14:23 +01:00
add a separate flag to indicate that the loading screen is being shown
This commit is contained in:
parent
0ebb85a660
commit
ad26fe14ad
3 changed files with 4 additions and 1 deletions
|
@ -30,7 +30,7 @@ SYMBOL_INTERNAL void SimpleCompositor(struct Game* game, struct Gamestate* games
|
||||||
}
|
}
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
}
|
}
|
||||||
if (game->_priv.loading.inProgress) {
|
if (game->_priv.loading.shown) {
|
||||||
al_draw_bitmap(game->loading_fb, game->_priv.clip_rect.x, game->_priv.clip_rect.y, 0);
|
al_draw_bitmap(game->loading_fb, game->_priv.clip_rect.x, game->_priv.clip_rect.y, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,6 +165,7 @@ struct Game {
|
||||||
int progress;
|
int progress;
|
||||||
int loaded, toLoad;
|
int loaded, toLoad;
|
||||||
volatile bool inProgress;
|
volatile bool inProgress;
|
||||||
|
bool shown;
|
||||||
double time;
|
double time;
|
||||||
} loading;
|
} loading;
|
||||||
|
|
||||||
|
|
|
@ -256,6 +256,7 @@ static inline bool MainloopTick(struct Game* game) {
|
||||||
while (game->_priv.loading.inProgress) {
|
while (game->_priv.loading.inProgress) {
|
||||||
double delta = al_get_time() - game->_priv.loading.time;
|
double delta = al_get_time() - game->_priv.loading.time;
|
||||||
if (tmp->showLoading) {
|
if (tmp->showLoading) {
|
||||||
|
game->_priv.loading.shown = true;
|
||||||
(*game->_priv.loading.gamestate->api->Gamestate_Logic)(game, game->_priv.loading.gamestate->data, delta);
|
(*game->_priv.loading.gamestate->api->Gamestate_Logic)(game, game->_priv.loading.gamestate->data, delta);
|
||||||
DrawGamestates(game);
|
DrawGamestates(game);
|
||||||
}
|
}
|
||||||
|
@ -306,6 +307,7 @@ static inline bool MainloopTick(struct Game* game) {
|
||||||
}
|
}
|
||||||
if (tmp->showLoading) {
|
if (tmp->showLoading) {
|
||||||
(*game->_priv.loading.gamestate->api->Gamestate_Stop)(game, game->_priv.loading.gamestate->data);
|
(*game->_priv.loading.gamestate->api->Gamestate_Stop)(game, game->_priv.loading.gamestate->data);
|
||||||
|
game->_priv.loading.shown = false;
|
||||||
}
|
}
|
||||||
tmp->showLoading = true;
|
tmp->showLoading = true;
|
||||||
al_resume_timer(game->_priv.timer);
|
al_resume_timer(game->_priv.timer);
|
||||||
|
|
Loading…
Reference in a new issue