mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03: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:
@@ -17,21 +17,22 @@ if env["threads_enabled"]:
|
||||
|
||||
build = env.add_program(build_targets, javascript_files)
|
||||
|
||||
js_libraries = [
|
||||
"native/http_request.js",
|
||||
"native/library_godot_audio.js",
|
||||
]
|
||||
for lib in js_libraries:
|
||||
env.Append(LINKFLAGS=["--js-library", env.File(lib).path])
|
||||
env.Depends(build, js_libraries)
|
||||
env.AddJSLibraries(
|
||||
[
|
||||
"native/http_request.js",
|
||||
"native/library_godot_audio.js",
|
||||
"native/library_godot_display.js",
|
||||
"native/library_godot_os.js",
|
||||
]
|
||||
)
|
||||
|
||||
js_pre = [
|
||||
"native/id_handler.js",
|
||||
"native/utils.js",
|
||||
]
|
||||
for js in js_pre:
|
||||
env.Append(LINKFLAGS=["--pre-js", env.File(js).path])
|
||||
env.Depends(build, js_pre)
|
||||
if env["tools"]:
|
||||
env.AddJSLibraries(["native/library_godot_editor_tools.js"])
|
||||
if env["javascript_eval"]:
|
||||
env.AddJSLibraries(["native/library_godot_eval.js"])
|
||||
for lib in env["JS_LIBS"]:
|
||||
env.Append(LINKFLAGS=["--js-library", lib])
|
||||
env.Depends(build, env["JS_LIBS"])
|
||||
|
||||
engine = [
|
||||
"engine/preloader.js",
|
||||
|
||||
Reference in New Issue
Block a user