add more drawing (and sleeping in emscripten) to improve responsiveness around loading

This commit is contained in:
Sebastian Krzyszkowiak 2019-01-08 05:19:37 +01:00
parent f07b075052
commit d55fbebe4d
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

@ -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
} }