return time;
}
-
+#ifdef __EMSCRIPTEN__
+EM_JS(void,emshutdown,(),{FS.syncfs(); window.close();});
+#endif
void Host_Loop(void){
// Something bad happened, or the server disconnected
if (setjmp(host.abortframe))
sleeptime -= Sys_DirtyTime() - host.dirtytime; // execution time
host.sleeptime = Host_Sleep(sleeptime);
+ #ifdef __EMSCRIPTEN__
+ if(host.state == host_shutdown){
+ emshutdown();
+ }
+ #endif
}
void Host_Main(void)
#define GAMENAME "id1"
#define STARTCONFIGFILENAME "quake.rc"
-#define CONFIGFILENAME "config.cfg"
+#ifndef __EMSCRIPTEN__
+ #define CONFIGFILENAME "config.cfg"
+#else
+ #define CONFIGFILENAME "/data/config.cfg"
+#endif
// moveflags values
#define MOVEFLAG_VALID 0x80000000