Revert WebAssembly improvements (moved to 8.1.0-Dev branch)

This commit is contained in:
Joshua Granick
2023-05-30 09:03:18 -07:00
parent 1a46366823
commit 35d1436dcd
34 changed files with 189 additions and 289 deletions

View File

@@ -9,7 +9,7 @@
<set name="tvos" value="1" if="appletv" />
<set name="LIME_CAIRO" value="1" />
<set name="LIME_CURL" value="1" unless="winrt" />
<set name="LIME_CURL" value="1" unless="emscripten || winrt" />
<set name="LIME_EFSW" value="1" if="windows || mac || linux" unless="winrt" />
<set name="LIME_JPEG" value="1" />
<!-- <set name="LIME_FAUDIO" value="1" /> -->
@@ -22,7 +22,7 @@
<!-- <set name="LIME_NEKO" value="1" if="linux" /> -->
<set name="LIME_OGG" value="1" />
<set name="LIME_OPENALSOFT" value="1" if="windows || linux || mac || android" unless="static_link" />
<set name="LIME_OPENAL" value="1" if="iphone || webassembly || tvos" />
<set name="LIME_OPENAL" value="1" if="iphone || emscripten || tvos" />
<set name="LIME_MOJOAL" value="1" if="switch || static_link || winrt || mojoal" unless="LIME_OPENAL" />
<unset name="LIME_OPENALSOFT" if="LIME_MOJOAL" />
<set name="LIME_OPENAL" value="1" if="LIME_OPENALSOFT" />

View File

@@ -28,8 +28,6 @@ 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

@@ -42,6 +42,12 @@ namespace lime {
framePeriod = 1000.0 / 60.0;
#ifdef EMSCRIPTEN
emscripten_cancel_main_loop ();
emscripten_set_main_loop (UpdateFrame, 0, 0);
emscripten_set_main_loop_timing (EM_TIMING_RAF, 1);
#endif
currentUpdate = 0;
lastUpdate = 0;
nextUpdate = 0;
@@ -89,12 +95,6 @@ namespace lime {
Init ();
#ifdef EMSCRIPTEN
emscripten_cancel_main_loop ();
emscripten_set_main_loop (UpdateFrame, 0, 0);
emscripten_set_main_loop_timing (EM_TIMING_RAF, 1);
#endif
#if defined(IPHONE) || defined(EMSCRIPTEN)
return 0;
@@ -891,7 +891,7 @@ namespace lime {
currentUpdate = SDL_GetTicks ();
#if defined (IPHONE) || defined (EMSCRIPTEN)
#if defined (IPHONE)
if (currentUpdate >= nextUpdate) {
@@ -901,6 +901,12 @@ namespace lime {
}
#elif defined (EMSCRIPTEN)
event.type = SDL_USEREVENT;
HandleEvent (&event);
event.type = -1;
#else
if (currentUpdate >= nextUpdate) {
@@ -926,16 +932,8 @@ namespace lime {
void SDLApplication::UpdateFrame () {
#ifdef EMSCRIPTEN
System::GCTryExitBlocking ();
#endif
currentApplication->Update ();
#ifdef EMSCRIPTEN
System::GCTryEnterBlocking ();
#endif
}

View File

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

View File

@@ -13,9 +13,9 @@
#elif defined (EMSCRIPTEN)
#define LIME_GLES
// #define LIME_GLES3_API
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#define LIME_GLES3_API
#include <GLES3/gl3.h>
#include <GLES3/gl2ext.h>
#elif defined (TIZEN)

View File

@@ -42,28 +42,6 @@ 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) {