diff options
| author | Leon Krause | 2018-03-27 11:23:38 +0200 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-04-28 19:54:19 +0200 |
| commit | 393e1ef4ee4d5522ab28378eb88fef76a6eef8a0 (patch) | |
| tree | b6e7db33c116f2e1b6cf93d4bf41a4896fa6d650 /platform/javascript/engine.js | |
| parent | 78b44eab0a4d2fbfd5c29984dcad6b1b0600bd0f (diff) | |
| download | godot-393e1ef4ee4d5522ab28378eb88fef76a6eef8a0.tar.gz godot-393e1ef4ee4d5522ab28378eb88fef76a6eef8a0.tar.zst godot-393e1ef4ee4d5522ab28378eb88fef76a6eef8a0.zip | |
Allow custom path when using engine.js preloadFile() with URL
(cherry picked from commit d373029382208226a55ddfc028a3261e0dc8279b)
Diffstat (limited to 'platform/javascript/engine.js')
| -rw-r--r-- | platform/javascript/engine.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/javascript/engine.js b/platform/javascript/engine.js index afd912bf3..dab7104af 100644 --- a/platform/javascript/engine.js +++ b/platform/javascript/engine.js @@ -88,7 +88,7 @@ }); } - this.preloadFile = function(pathOrBuffer, bufferFilename) { + this.preloadFile = function(pathOrBuffer, destPath) { if (pathOrBuffer instanceof ArrayBuffer) { pathOrBuffer = new Uint8Array(pathOrBuffer); @@ -97,14 +97,14 @@ } if (pathOrBuffer instanceof Uint8Array) { preloadedFiles.push({ - path: bufferFilename, + path: destPath, buffer: pathOrBuffer }); return Promise.resolve(); } else if (typeof pathOrBuffer === 'string') { return loadPromise(pathOrBuffer, preloadProgressTracker).then(function(xhr) { preloadedFiles.push({ - path: pathOrBuffer, + path: destPath || pathOrBuffer, buffer: xhr.response }); }); |
