mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 22:21:18 +00:00
[HTML5] GDNative support via SIDE_MODULE.
Working with emscripten >= 2.0.10
This commit is contained in:
parent
1167ab96e9
commit
ca34b5e57a
8 changed files with 109 additions and 33 deletions
|
|
@ -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`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue