Add: [Emscripten] Support for bootstrapping

This commit is contained in:
glx22
2023-07-06 18:20:33 +02:00
committed by Loïc Guilloux
parent 3d1c4a8589
commit 4eddec9e79
4 changed files with 120 additions and 29 deletions

View File

@@ -615,7 +615,11 @@ void VideoDriver_SDL_Base::LoopOnce()
/* In effect, the game ends here. As emscripten_set_main_loop() caused
* the stack to be unwound, the code after MainLoop() in
* openttd_main() is never executed. */
EM_ASM(if (window["openttd_exit"]) openttd_exit());
if (_game_mode == GM_BOOTSTRAP) {
EM_ASM(if (window["openttd_bootstrap_reload"]) openttd_bootstrap_reload());
} else {
EM_ASM(if (window["openttd_exit"]) openttd_exit());
}
#endif
return;
}