--- a/rts/Game/LoadScreen.cpp +++ b/rts/Game/LoadScreen.cpp @@ -8,6 +8,7 @@ #ifdef __EMSCRIPTEN__ #include #include +#include #endif #include "Game.h" #include "GlobalUnsynced.h" @@ -139,6 +140,11 @@ } } +#ifdef __EMSCRIPTEN__ + // Preserve a higher requested value across game LuaIntro config writes. + const float webbarGcLoadFloor = std::max(4.0f, configHandler->GetFloat("LuaGarbageCollectionMemLoadMult")); +#endif + // LuaIntro must be loaded and killed in the same thread (main) // and bound context (secondary) that CLoadScreen::Draw runs in // @@ -150,6 +156,11 @@ CLuaIntro::LoadFreeHandler(); } +#ifdef __EMSCRIPTEN__ + // LuaRules/LuaGaia capture this effective value during construction. + configHandler->Set("LuaGarbageCollectionMemLoadMult", std::max(webbarGcLoadFloor, configHandler->GetFloat("LuaGarbageCollectionMemLoadMult")), true); +#endif + if (mtLoading) return true;