summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-03-29 15:21:52 +0200
committerGitHub <noreply@github.com>2017-03-29 15:21:52 +0200
commit000e8730088ed241439a311c1bd0167f741ffbd1 (patch)
treef178ebbe6c842324dbc6ababa62a51db267bb55b /misc
parentd4740a98537b1e7dcb6fb48176abdebe27eee83c (diff)
parent7df7e9cc8bbe25148698f4350123a42e17033881 (diff)
Merge pull request #8191 from eska014/webgl2-export
WebGL 2 export per WebAssembly or asm.js
Diffstat (limited to 'misc')
-rw-r--r--misc/dist/html_fs/godotfs.js12
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');
};