From 7df7e9cc8bbe25148698f4350123a42e17033881 Mon Sep 17 00:00:00 2001 From: eska Date: Tue, 28 Mar 2017 03:21:21 +0200 Subject: WebGL 2 export per WebAssembly or asm.js --- misc/dist/html_fs/godotfs.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'misc') 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'); }; -- cgit v1.2.3