From ee99cd42d5e60f8f3d66889df3056f0b2261ec7d Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 1 May 2020 14:36:41 +0200 Subject: [HTML5] Locale, input fix, context, exit. Add missing semicolumns in engine.js Add optional extra args to JS Engine.startGame Remove loader.js, explicit noExitRuntime. Also add onExit callback (undocumented in emscripten) --- platform/javascript/detect.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'platform/javascript/detect.py') diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 9486e10717..c1c48a4b93 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -164,3 +164,6 @@ def configure(env): # callMain for manual start, FS for preloading. env.Append(LINKFLAGS=["-s", 'EXTRA_EXPORTED_RUNTIME_METHODS=["callMain", "FS"]']) + + # Add code that allow exiting runtime. + env.Append(LINKFLAGS=['-s', 'EXIT_RUNTIME=1']) -- cgit v1.2.3 From 7411e7fd37eb169b0f0675d4e4c2ec28786aec1b Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 1 May 2020 14:45:45 +0200 Subject: DisplayServerJavaScript implementation. --- platform/javascript/detect.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'platform/javascript/detect.py') diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index c1c48a4b93..5a0f8503f9 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -2,7 +2,6 @@ import os from emscripten_helpers import parse_config, run_closure_compiler, create_engine_file - def is_active(): return True @@ -17,12 +16,11 @@ def can_build(): def get_opts(): from SCons.Variables import BoolVariable - return [ # eval() can be a security concern, so it can be disabled. BoolVariable("javascript_eval", "Enable JavaScript eval interface", True), BoolVariable("threads_enabled", "Enable WebAssembly Threads support (limited browser support)", False), - BoolVariable("use_closure_compiler", "Use closure compiler to minimize Javascript code", False), + BoolVariable("use_closure_compiler", "Use closure compiler to minimize JavaScript code", False), ] @@ -57,7 +55,7 @@ def configure(env): env.Append(CPPDEFINES=["DEBUG_ENABLED"]) # Retain function names for backtraces at the cost of file size. env.Append(LINKFLAGS=["--profiling-funcs"]) - else: # 'debug' + else: # "debug" env.Append(CPPDEFINES=["DEBUG_ENABLED"]) env.Append(CCFLAGS=["-O1", "-g"]) env.Append(LINKFLAGS=["-O1", "-g"]) @@ -150,7 +148,7 @@ def configure(env): env.Append(LIBS=["idbfs.js"]) env.Append(LINKFLAGS=["-s", "BINARYEN=1"]) - env.Append(LINKFLAGS=["-s", "MODULARIZE=1", "-s", 'EXPORT_NAME="Godot"']) + env.Append(LINKFLAGS=["-s", "MODULARIZE=1", "-s", "EXPORT_NAME='Godot'"]) # Allow increasing memory buffer size during runtime. This is efficient # when using WebAssembly (in comparison to asm.js) and works well for @@ -162,8 +160,10 @@ def configure(env): env.Append(LINKFLAGS=["-s", "INVOKE_RUN=0"]) - # callMain for manual start, FS for preloading. - env.Append(LINKFLAGS=["-s", 'EXTRA_EXPORTED_RUNTIME_METHODS=["callMain", "FS"]']) + # Allow use to take control of swapping WebGL buffers. + env.Append(LINKFLAGS=["-s", "OFFSCREEN_FRAMEBUFFER=1"]) + # callMain for manual start, FS for preloading, PATH and ERRNO_CODES for BrowserFS. + env.Append(LINKFLAGS=["-s", "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain', 'FS', 'PATH', 'ERRNO_CODES']"]) # Add code that allow exiting runtime. - env.Append(LINKFLAGS=['-s', 'EXIT_RUNTIME=1']) + env.Append(LINKFLAGS=["-s", "EXIT_RUNTIME=1"]) -- cgit v1.2.3 From d2eef397312d1c142d95c2aef0ff3d5aeee6495a Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Fri, 8 May 2020 16:55:01 +0200 Subject: Fix Closure compiler build, python style. Move copyToFS into utils.js library included with '--pre-js'. --- platform/javascript/detect.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'platform/javascript/detect.py') diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 5a0f8503f9..81287cead8 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -2,6 +2,7 @@ import os from emscripten_helpers import parse_config, run_closure_compiler, create_engine_file + def is_active(): return True @@ -16,6 +17,7 @@ def can_build(): def get_opts(): from SCons.Variables import BoolVariable + return [ # eval() can be a security concern, so it can be disabled. BoolVariable("javascript_eval", "Enable JavaScript eval interface", True), @@ -55,7 +57,7 @@ def configure(env): env.Append(CPPDEFINES=["DEBUG_ENABLED"]) # Retain function names for backtraces at the cost of file size. env.Append(LINKFLAGS=["--profiling-funcs"]) - else: # "debug" + else: # "debug" env.Append(CPPDEFINES=["DEBUG_ENABLED"]) env.Append(CCFLAGS=["-O1", "-g"]) env.Append(LINKFLAGS=["-O1", "-g"]) @@ -164,6 +166,6 @@ def configure(env): env.Append(LINKFLAGS=["-s", "OFFSCREEN_FRAMEBUFFER=1"]) # callMain for manual start, FS for preloading, PATH and ERRNO_CODES for BrowserFS. - env.Append(LINKFLAGS=["-s", "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain', 'FS', 'PATH', 'ERRNO_CODES']"]) + env.Append(LINKFLAGS=["-s", "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain', 'FS', 'PATH']"]) # Add code that allow exiting runtime. env.Append(LINKFLAGS=["-s", "EXIT_RUNTIME=1"]) -- cgit v1.2.3