From 16b9abe64f7220c841d5172f652a23d981976505 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Mon, 2 Oct 2023 20:45:47 +0900 Subject: [PATCH] Emscripten: Introduce xsystem35.shell.onExit() It notifies the shell of the exit event and allows it to change the exit code. --- src/sys/nact.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sys/nact.cpp b/src/sys/nact.cpp index 114226f..7474ef5 100644 --- a/src/sys/nact.cpp +++ b/src/sys/nact.cpp @@ -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;