diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-10-01 20:15:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-01 20:15:41 +0200 |
commit | bf1c81adf4b1584470318d25fa2ef67e261874cf (patch) | |
tree | d6e405da4a9e4e9aeaee0cab0b64f388fec55cfe /platform/javascript/engine.js | |
parent | 052c5733b79b10db4737d4cfee42795c22f52799 (diff) | |
parent | 6f1d6cfc7815d753bb073e55191decb0520965f9 (diff) | |
download | redot-engine-bf1c81adf4b1584470318d25fa2ef67e261874cf.tar.gz |
Merge pull request #32448 from Relintai/fix_run_with_new_emscripten
Fix for running the export templates with newer emscripten versions.
Diffstat (limited to 'platform/javascript/engine.js')
-rw-r--r-- | platform/javascript/engine.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/platform/javascript/engine.js b/platform/javascript/engine.js index 860d6707ff..1f78aa672d 100644 --- a/platform/javascript/engine.js +++ b/platform/javascript/engine.js @@ -94,6 +94,7 @@ return new Promise(function(resolve, reject) { rtenvProps.onRuntimeInitialized = resolve; rtenvProps.onAbort = reject; + rtenvProps.thisProgram = executableName; rtenvProps.engine.rtenv = Engine.RuntimeEnvironment(rtenvProps, LIBS); }); } @@ -130,13 +131,11 @@ ); }; - this.startGame = function(mainPack) { + this.startGame = function(execName, mainPack) { + + executableName = execName; + var mainArgs = [ '--main-pack', mainPack ]; - executableName = getBaseName(mainPack); - var mainArgs = []; - if (!getPathLeaf(mainPack).endsWith('.pck')) { - mainArgs = ['--main-pack', getPathLeaf(mainPack)]; - } return Promise.all([ // Load from directory, this.init(getBasePath(mainPack)), @@ -187,8 +186,6 @@ this.rtenv.locale = this.rtenv.locale.split('.')[0]; this.rtenv.resizeCanvasOnStart = resizeCanvasOnStart; - this.rtenv.thisProgram = executableName || getBaseName(basePath); - preloadedFiles.forEach(function(file) { var dir = LIBS.PATH.dirname(file.path); try { |