mirror of
https://github.com/godotengine/godot.git
synced 2025-10-28 20:24:41 +00:00
[HTML5] Port JavaScript inline code to libraries.
The API is implemented in javascript, and generates C functions that can be called from godot. This allows much cleaner code replacing all `EM_ASM` calls in our C++ code with plain C function calls. This also gets rid of few hacks and comes with few optimizations (e.g. custom cursor shapes should be much faster now).
This commit is contained in:
parent
a7ecb3c048
commit
e52ed6d89e
31 changed files with 2016 additions and 1502 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
|
||||
from emscripten_helpers import run_closure_compiler, create_engine_file
|
||||
from emscripten_helpers import run_closure_compiler, create_engine_file, add_js_libraries
|
||||
from SCons.Util import WhereIs
|
||||
|
||||
|
||||
|
|
@ -96,6 +96,9 @@ def configure(env):
|
|||
jscc = env.Builder(generator=run_closure_compiler, suffix=".cc.js", src_suffix=".js")
|
||||
env.Append(BUILDERS={"BuildJS": jscc})
|
||||
|
||||
# Add helper method for adding libraries.
|
||||
env.AddMethod(add_js_libraries, "AddJSLibraries")
|
||||
|
||||
# Add method that joins/compiles our Engine files.
|
||||
env.AddMethod(create_engine_file, "CreateEngineFile")
|
||||
|
||||
|
|
@ -166,6 +169,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']"])
|
||||
env.Append(LINKFLAGS=["-s", "EXTRA_EXPORTED_RUNTIME_METHODS=['callMain']"])
|
||||
# Add code that allow exiting runtime.
|
||||
env.Append(LINKFLAGS=["-s", "EXIT_RUNTIME=1"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue