Minor WebAssembly adjustments

This commit is contained in:
Joshua Granick
2023-05-24 12:37:17 -07:00
parent 79e11e4270
commit 58275329cc
5 changed files with 39 additions and 1 deletions

View File

@@ -28,6 +28,8 @@ namespace lime {
static void GCEnterBlocking ();
static void GCExitBlocking ();
static void GCTryEnterBlocking ();
static void GCTryExitBlocking ();
static bool GetAllowScreenTimeout ();
static std::wstring* GetDeviceModel ();
static std::wstring* GetDeviceVendor ();

View File

@@ -928,8 +928,16 @@ namespace lime {
void SDLApplication::UpdateFrame () {
#ifdef EMSCRIPTEN
System::GCTryExitBlocking ();
#endif
currentApplication->Update ();
#ifdef EMSCRIPTEN
System::GCTryEnterBlocking ();
#endif
}

View File

@@ -201,7 +201,9 @@ namespace lime {
// if (window->flags & WINDOW_FLAG_VSYNC) {
// sdlRendererFlags |= SDL_RENDERER_PRESENTVSYNC;
#ifdef EMSCRIPTEN
sdlRendererFlags |= SDL_RENDERER_PRESENTVSYNC;
#endif
// }

View File

@@ -42,6 +42,28 @@ namespace lime {
}
void System::GCTryEnterBlocking () {
if (!_isHL) {
gc_try_blocking ();
}
}
void System::GCTryExitBlocking () {
if (!_isHL) {
gc_try_unblocking ();
}
}
#if defined (HX_WINDOWS) && !defined (HX_WINRT)
std::wstring* GetWMIValue (BSTR query, BSTR field) {

View File

@@ -206,6 +206,10 @@ class WebAssemblyPlatform extends PlatformTarget
args.push("ASSERTIONS=1");
}
// set initial size
args.push("-s");
args.push("TOTAL_MEMORY=32MB");
if (project.targetFlags.exists("final"))
{
args.push("-O3");