diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index e309c6d..39821ff 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -2,7 +2,7 @@ name: Emscripten Build on: [push] env: - emscripten-version: 1.39.8 + emscripten-version: 1.39.16 jobs: build: diff --git a/src/sdlmain.cpp b/src/sdlmain.cpp index 609228a..80a80a2 100644 --- a/src/sdlmain.cpp +++ b/src/sdlmain.cpp @@ -18,6 +18,12 @@ int main(int argc, char *argv[]) { SDL_Init(SDL_INIT_VIDEO); +#ifdef __EMSCRIPTEN__ + // Stop SDL from calling emscripten_sleep() in functions that are called + // indirectly, which does not work with ASYNCIFY_IGNORE_INDIRECT=1. For + // details, see https://github.com/emscripten-core/emscripten/issues/10746. + SDL_SetHint(SDL_HINT_EMSCRIPTEN_ASYNCIFY, "0"); +#endif #ifdef __ANDROID__ SDL_SetHint(SDL_HINT_ORIENTATIONS, "LandscapeLeft LandscapeRight"); Uint32 flags = SDL_WINDOW_FULLSCREEN;