emscripten: Restore a hack to asyncify send_agsevent() callers

It was inadvertently removed in commit 61ad428.
This commit is contained in:
kichikuou
2024-11-27 09:12:39 +09:00
parent ade76adda6
commit 80988e52cf
2 changed files with 10 additions and 0 deletions
+3
View File
@@ -162,6 +162,9 @@ if (EMSCRIPTEN)
-sASYNCIFY_IGNORE_INDIRECT=1
-sASYNCIFY_REMOVE=SDL_Delay
-sASYNCIFY_IMPORTS=wait_vsync
# Functions that call an asynchronous function via a function pointer must
# be added to ASYNCIFY_ADD, even if it had a direct call to another
# asynchronous function, so that the indirect call itself is instrumented.
-sASYNCIFY_ADD=commands2F60,nact_main,send_agsevent,cb_waitkey_sprite
-sALLOW_MEMORY_GROWTH=1
-sNO_EXIT_RUNTIME=1
+7
View File
@@ -222,6 +222,13 @@ void send_agsevent(enum agsevent_type type, int code) {
.mousey = mousey
};
nact->ags.eventcb(&agse); // Async in emscripten
#ifdef __EMSCRIPTEN__
// HACK: this ensures that callers of this function are instrumented.
// This is necessary because ASYNCIFY_PROPAGATE_ADD does not work:
// https://github.com/emscripten-core/emscripten/issues/23015
emscripten_sleep(0);
#endif
}
void sdl_setCursorInternalLocation(int x, int y) {