Skip to content

Commit

Permalink
Merge pull request #1502 from RblSb/patch-1
Browse files Browse the repository at this point in the history
Another nightly fix
  • Loading branch information
RobDangerous authored Jan 7, 2025
2 parents be157f3 + de988da commit 8035664
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Backends/HTML5/kha/LoaderImpl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ class LoaderImpl {
}

public static function loadRemote(desc: Dynamic, done: Blob->Void, failed: AssetError->Void) {
var request = untyped new XMLHttpRequest();
var request = new XMLHttpRequest();
request.open("GET", desc.files[0], true);
request.responseType = "arraybuffer";
request.responseType = ARRAYBUFFER;

request.onreadystatechange = function() {
if (request.readyState != 4)
Expand All @@ -174,12 +174,6 @@ class LoaderImpl {
var byteArray: Dynamic = Syntax.code("new Uint8Array(arrayBuffer)");
bytes = Bytes.ofData(byteArray);
}
else if (request.responseBody != null) {
var data: Dynamic = untyped Syntax.code("VBArray(request.responseBody).toArray()");
bytes = Bytes.alloc(data.length);
for (i in 0...data.length)
bytes.set(i, data[i]);
}
else {
failed({url: desc.files[0]});
return;
Expand Down

0 comments on commit 8035664

Please sign in to comment.