diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-10-24 16:02:09 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2020-12-05 00:52:43 +0100 |
commit | ca34b5e57a79d843bb5a57f13fb2f674e1d801e7 (patch) | |
tree | fa79e016fa767abfdf568c10205a7293bb858c13 /platform/javascript/js/engine | |
parent | 1167ab96e9be2a86b1315693b843820eef978685 (diff) |
[HTML5] GDNative support via SIDE_MODULE.
Working with emscripten >= 2.0.10
Diffstat (limited to 'platform/javascript/js/engine')
-rw-r--r-- | platform/javascript/js/engine/engine.js | 6 | ||||
-rw-r--r-- | platform/javascript/js/engine/utils.js | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/platform/javascript/js/engine/engine.js b/platform/javascript/js/engine/engine.js index 74153b672a..f0abdff640 100644 --- a/platform/javascript/js/engine/engine.js +++ b/platform/javascript/js/engine/engine.js @@ -58,6 +58,9 @@ const Engine = (function () { initPromise = new Promise(function (resolve, reject) { config['locateFile'] = Utils.createLocateRewrite(loadPath); config['instantiateWasm'] = Utils.createInstantiatePromise(loadPromise); + // Emscripten configuration. + config['thisProgram'] = me.executableName; + config['noExitRuntime'] = true; Godot(config).then(function (module) { module['initFS'](me.persistentPaths).then(function (fs_err) { me.rtenv = module; @@ -119,9 +122,6 @@ const Engine = (function () { locale = navigator.languages ? navigator.languages[0] : navigator.language; locale = locale.split('.')[0]; } - // Emscripten configuration. - me.rtenv['thisProgram'] = me.executableName; - me.rtenv['noExitRuntime'] = true; // Godot configuration. me.rtenv['initConfig']({ 'resizeCanvasOnStart': me.resizeCanvasOnStart, diff --git a/platform/javascript/js/engine/utils.js b/platform/javascript/js/engine/utils.js index d0fca4e1cb..9273bbad42 100644 --- a/platform/javascript/js/engine/utils.js +++ b/platform/javascript/js/engine/utils.js @@ -8,6 +8,8 @@ const Utils = { // eslint-disable-line no-unused-vars return `${execName}.audio.worklet.js`; } else if (path.endsWith('.js')) { return `${execName}.js`; + } else if (path.endsWith('.side.wasm')) { + return `${execName}.side.wasm`; } else if (path.endsWith('.wasm')) { return `${execName}.wasm`; } |