mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-07 21:56:44 +01:00
emscripten: pause the mainloop during loading
Fixes blinks of a blank screen when async calls are made.
This commit is contained in:
parent
08ee8f142c
commit
2333ff1187
1 changed files with 7 additions and 0 deletions
|
@ -243,6 +243,10 @@ static inline bool MainloopTick(struct Game* game) {
|
|||
|
||||
struct Gamestate* tmp = game->_priv.gamestates;
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_pause_main_loop();
|
||||
#endif
|
||||
|
||||
game->_priv.loading.to_load = 0;
|
||||
game->_priv.loading.loaded = 0;
|
||||
game->_priv.loading.lock = true;
|
||||
|
@ -428,6 +432,9 @@ static inline bool MainloopTick(struct Game* game) {
|
|||
}
|
||||
|
||||
game->_priv.loading.lock = false;
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_resume_main_loop();
|
||||
#endif
|
||||
|
||||
if (!gameActive) {
|
||||
PrintConsole(game, "No gamestates left, exiting...");
|
||||
|
|
Loading…
Reference in a new issue