Emscripten: Introduce xsystem35.shell.onExit()

It notifies the shell of the exit event and allows it to change the exit
code.
This commit is contained in:
kichikuou
2023-10-02 20:45:47 +09:00
parent bcb653ca14
commit 16b9abe64f
+1 -2
View File
@@ -147,8 +147,7 @@ int NACT::mainloop()
void NACT::quit(int code)
{
#ifdef __EMSCRIPTEN__
if (code >= 0)
code = NACT_RESTART; // Restarts the game instead of exiting.
code = EM_ASM_INT({ return xsystem35.shell.onExit($0); }, code);
#endif
exit_code = code;
terminate = true;