You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
[HTML5] GDNative support via SIDE_MODULE.
Working with emscripten >= 2.0.10
This commit is contained in:
1
platform/javascript/js/dynlink.pre.js
Normal file
1
platform/javascript/js/dynlink.pre.js
Normal file
@@ -0,0 +1 @@
|
||||
Module['dynamicLibraries'] = [Module['thisProgram'] + '.side.wasm'];
|
||||
@@ -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,
|
||||
|
||||
@@ -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`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user