mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-07 21:56:44 +01:00
add more drawing (and sleeping in emscripten) to improve responsiveness around loading
This commit is contained in:
parent
f07b075052
commit
d55fbebe4d
1 changed files with 9 additions and 0 deletions
|
@ -303,6 +303,9 @@ static inline bool MainloopTick(struct Game* game) {
|
||||||
DrawGamestates(game);
|
DrawGamestates(game);
|
||||||
DrawConsole(game);
|
DrawConsole(game);
|
||||||
al_flip_display();
|
al_flip_display();
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
emscripten_sleep(0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef LIBSUPERDERPY_SINGLE_THREAD
|
#ifndef LIBSUPERDERPY_SINGLE_THREAD
|
||||||
al_run_detached_thread(GamestateLoadingThread, &data);
|
al_run_detached_thread(GamestateLoadingThread, &data);
|
||||||
|
@ -337,6 +340,9 @@ static inline bool MainloopTick(struct Game* game) {
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
GamestateLoadingThread(&data);
|
GamestateLoadingThread(&data);
|
||||||
|
DrawGamestates(game);
|
||||||
|
DrawConsole(game);
|
||||||
|
al_flip_display();
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
emscripten_sleep(0);
|
emscripten_sleep(0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -373,6 +379,9 @@ static inline bool MainloopTick(struct Game* game) {
|
||||||
ReloadShaders(game, false);
|
ReloadShaders(game, false);
|
||||||
MainloopEvents(game); // consume queued events
|
MainloopEvents(game); // consume queued events
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
|
DrawGamestates(game);
|
||||||
|
DrawConsole(game);
|
||||||
|
al_flip_display();
|
||||||
emscripten_sleep(0);
|
emscripten_sleep(0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue