mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-10-05 05:07:58 +03:00
emscripten: Restore a hack to asyncify send_agsevent() callers
It was inadvertently removed in commit 61ad428.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user