[ion/simulator] Allow web-simulator to be built.

This commit is contained in:
M4x1m3
2019-11-10 13:47:43 +01:00
parent 7a48e18640
commit 864abac52b
3 changed files with 10 additions and 2 deletions

View File

@@ -8,6 +8,8 @@ SAFE_HEAP_STORE \
_IonEventsEmscriptenKeyDown \
_IonEventsEmscriptenKeyUp \
_IonEventsEmscriptenPushEvent \
_IonSimulatorCallbackDidScanKeyboard \
__Z8ion_mainiPKPKc \
__Z8ion_mainiPPc \
__ZN10Invocation7performEPv \
__ZN11MicroPython20ExecutionEnvironment7runCodeEPKc \
@@ -108,8 +110,11 @@ EMFLAGS += --profiling-funcs
EMFLAGS += -s ASSERTIONS=1
EMFLAGS += -s SAFE_HEAP=1
EMFLAGS += -s STACK_OVERFLOW_CHECK=1
EMFLAGS += -s DEMANGLE_SUPPORT=1
endif
# EMFLAGS += -s ERROR_ON_UNDEFINED_SYMBOLS=0
# Configure EMFLAGS
EMFLAGS += -s WASM=0
@@ -120,4 +125,4 @@ EMSCRIPTEN_INIT_FILE ?= 0
LDFLAGS += --memory-init-file $(EMSCRIPTEN_INIT_FILE)
SFLAGS += $(EMFLAGS)
LDFLAGS += $(EMFLAGS) -Oz -s EXPORTED_FUNCTIONS='["_main", "_IonSimulatorKeyboardKeyDown", "_IonSimulatorKeyboardKeyUp", "_IonSimulatorEventsPushEvent", "_IonSoftwareVersion", "_IonPatchLevel"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["UTF8ToString"]'
LDFLAGS += $(EMFLAGS) -Oz -s EXPORTED_FUNCTIONS='["_main", "_IonSimulatorKeyboardKeyDown", "_IonSimulatorKeyboardKeyUp", "_IonSimulatorEventsPushEvent", "_IonSoftwareVersion", "_IonPatchLevel"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["UTF8ToString", "Pointer_stringify"]'

View File

@@ -122,9 +122,12 @@ void init() {
Display::init(sRenderer);
// No need to load background in web simulator.
#ifndef __EMSCRIPTEN__
if (!argument_screen_only) {
sBackgroundTexture = IonSimulatorLoadImage(sRenderer, "background.jpg");
}
#endif
relayout();
}

View File

@@ -298,6 +298,6 @@ window.addEventListener("keydown", function(e) {
}
}, false);
</script>
<script async src="https://www.numworks.com/simulator/update.js"></script>
<!--<script async src="https://www.numworks.com/simulator/update.js"></script>-->
</body>
</html>