mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 02:56:43 +01:00
loading screen drawing tweaks
This commit is contained in:
parent
0d32d00890
commit
08ee8f142c
2 changed files with 12 additions and 2 deletions
|
@ -57,7 +57,7 @@ SYMBOL_INTERNAL void DrawGamestates(struct Game* game) {
|
|||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
if (game->_priv.loading.in_progress && game->loading.shown) {
|
||||
if (game->loading.shown) {
|
||||
// same as above, but for the loading gamestate
|
||||
game->_priv.current_gamestate = NULL;
|
||||
SetFramebufferAsTarget(game);
|
||||
|
|
|
@ -371,14 +371,21 @@ static inline bool MainloopTick(struct Game* game) {
|
|||
PrintConsole(game, "Gamestate \"%s\" loaded successfully in %f seconds.", tmp->name, al_get_time() - time);
|
||||
game->_priv.loading.loaded++;
|
||||
|
||||
DrawGamestates(game);
|
||||
DrawConsole(game);
|
||||
al_flip_display();
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_sleep(0);
|
||||
#endif
|
||||
|
||||
tmp->loaded = true;
|
||||
tmp->pending_load = false;
|
||||
}
|
||||
if (tmp->show_loading) {
|
||||
(*game->_priv.loading.gamestate->api->stop)(game, game->_priv.loading.gamestate->data);
|
||||
game->loading.shown = false;
|
||||
}
|
||||
tmp->show_loading = true;
|
||||
game->loading.shown = false;
|
||||
game->_priv.timestamp = al_get_time();
|
||||
#ifdef __EMSCRIPTEN__
|
||||
al_attach_mixer_to_voice(game->audio.mixer, game->audio.v);
|
||||
|
@ -424,6 +431,9 @@ static inline bool MainloopTick(struct Game* game) {
|
|||
|
||||
if (!gameActive) {
|
||||
PrintConsole(game, "No gamestates left, exiting...");
|
||||
ClearScreen(game);
|
||||
DrawConsole(game);
|
||||
al_flip_display();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue