From cf6142cbfacb283337cdc21c729826f77c771428 Mon Sep 17 00:00:00 2001 From: Victor Ripplinger Date: Thu, 14 Sep 2023 18:09:36 +0200 Subject: [PATCH] Make compatible with NWJS --- builds/ammo.js | 2 +- builds/ammo.wasm.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builds/ammo.js b/builds/ammo.js index 112cdb6a..1b0f32d2 100644 --- a/builds/ammo.js +++ b/builds/ammo.js @@ -19,7 +19,7 @@ G,ca){this.aF="function"==typeof p?p:null;this.bF="function"==typeof G?G:null;th fc.then;if("function"==typeof Vc){Vc.call(fc,function(Hc){Ia(Uc,Hc)},ca);return}}Eb[Uc]=fc;0===--XF&&G(Eb)}catch(Hc){ca(Hc)}}if(!Array.isArray(p))return ca(new TypeError("Promise.all accepts an array"));var Eb=Array.prototype.slice.call(p);if(0===Eb.length)return G([]);for(var XF=Eb.length,rc=0;rc { function(Ammo = {}) { var b;b||(b=typeof Ammo !== 'undefined' ? Ammo : {});var aa,ba;b.ready=new Promise(function(a,c){aa=a;ba=c});var ca=Object.assign({},b),da="object"==typeof window,ea="function"==typeof importScripts,fa="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,ha="",ia,ja,ka; -if(fa){var fs=require("fs"),la=require("path");ha=ea?la.dirname(ha)+"/":__dirname+"/";ia=(a,c)=>{a=a.startsWith("file://")?new URL(a):la.normalize(a);return fs.readFileSync(a,c?void 0:"utf8")};ka=a=>{a=ia(a,!0);a.buffer||(a=new Uint8Array(a));return a};ja=(a,c,d)=>{a=a.startsWith("file://")?new URL(a):la.normalize(a);fs.readFile(a,function(e,g){e?d(e):c(g.buffer)})};1{a=a.startsWith("file://")?new URL(a):la.normalize(a);return fs.readFileSync(a,c?void 0:"utf8")};ka=a=>{a=ia(a,!0);a.buffer||(a=new Uint8Array(a));return a};ja=(a,c,d)=>{a=a.startsWith("file://")?new URL(a):la.normalize(a);fs.readFile(a,function(e,g){e?d(e):c(g.buffer)})};1{var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);return c.responseText},ea&&(ka=a=>{var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),ja=(a,c,d)=>{var e=new XMLHttpRequest;e.open("GET",a, !0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d()};e.onerror=d;e.send(null)};b.print||console.log.bind(console);var ma=b.printErr||console.warn.bind(console);Object.assign(b,ca);ca=null;var na;b.wasmBinary&&(na=b.wasmBinary);var noExitRuntime=b.noExitRuntime||!0;"object"!=typeof WebAssembly&&oa("no native wasm support detected");var pa,qa=!1,ra="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0; function sa(a,c){if(a){var d=ta,e=a+c;for(c=a;d[c]&&!(c>=e);)++c;if(16g?e+=String.fromCharCode(g):(g-=65536,e+=String.fromCharCode(55296|g>>10,56320|g&1023))}}else e+=String.fromCharCode(g)}a=e}}else a="";return a}