WebGL 2 export per WebAssembly or asm.js
This commit is contained in:
12
misc/dist/html_fs/godotfs.js
vendored
12
misc/dist/html_fs/godotfs.js
vendored
@ -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');
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user