diff options
author | eska <eska@eska.me> | 2017-03-28 03:21:21 +0200 |
---|---|---|
committer | eska <eska@eska.me> | 2017-03-29 13:27:43 +0200 |
commit | 7df7e9cc8bbe25148698f4350123a42e17033881 (patch) | |
tree | 1352fd16ae9cb0142f2ae7e3d0395e877716da90 /misc | |
parent | efaeebab4d83e5657288b7b20db6ce4ccf987a01 (diff) |
WebGL 2 export per WebAssembly or asm.js
Diffstat (limited to 'misc')
-rw-r--r-- | misc/dist/html_fs/godotfs.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/misc/dist/html_fs/godotfs.js b/misc/dist/html_fs/godotfs.js index 2c59344cf5..676ee689fb 100644 --- a/misc/dist/html_fs/godotfs.js +++ b/misc/dist/html_fs/godotfs.js @@ -8,6 +8,8 @@ if (!Module.expectedDataFileDownloads) { Module.expectedDataFileDownloads++; (function() { + const PACK_FILE_NAME = '$GODOT_PACK_NAME'; + const PACK_FILE_SIZE = $GODOT_PACK_SIZE; function fetchRemotePackage(packageName, callback, errback) { var xhr = new XMLHttpRequest(); xhr.open('GET', packageName, true); @@ -52,7 +54,7 @@ Module.expectedDataFileDownloads++; }; var fetched = null, fetchedCallback = null; - fetchRemotePackage('data.pck', function(data) { + fetchRemotePackage(PACK_FILE_NAME, function(data) { if (fetchedCallback) { fetchedCallback(data); fetchedCallback = null; @@ -101,7 +103,7 @@ function assert(check, msg) { this.requests[this.name] = null; }, }; - new DataRequest(0, $DPLEN, 0, 0).open('GET', '/data.pck'); + new DataRequest(0, PACK_FILE_SIZE, 0, 0).open('GET', '/' + PACK_FILE_NAME); var PACKAGE_PATH; if (typeof window === 'object') { @@ -110,8 +112,8 @@ function assert(check, msg) { // worker PACKAGE_PATH = encodeURIComponent(location.pathname.toString().substring(0, location.pathname.toString().lastIndexOf('/')) + '/'); } - var PACKAGE_NAME = 'data.pck'; - var REMOTE_PACKAGE_NAME = 'data.pck'; + var PACKAGE_NAME = PACK_FILE_NAME; + var REMOTE_PACKAGE_NAME = PACK_FILE_NAME; var PACKAGE_UUID = 'b39761ce-0348-4959-9b16-302ed8e1592e'; function processPackageData(arrayBuffer) { @@ -122,7 +124,7 @@ function assert(check, msg) { // Reuse the bytearray from the XHR as the source for file reads. DataRequest.prototype.byteArray = byteArray; - DataRequest.prototype.requests["/data.pck"].onload(); + DataRequest.prototype.requests['/' + PACK_FILE_NAME].onload(); Module['removeRunDependency']('datafile_datapack'); }; |