forked from zeux/meshoptimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
decoder.js
48 lines (44 loc) · 19.7 KB
/
decoder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// This file is part of meshoptimizer library and is distributed under the terms of MIT License.
// Copyright (C) 2016-2019, by Arseny Kapoulkine ([email protected])
var MeshoptDecoder = (function() {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
return (
function(MeshoptDecoder) {
MeshoptDecoder = MeshoptDecoder || {};
var a;a||(a=typeof MeshoptDecoder !== 'undefined' ? MeshoptDecoder : {});var h={},k;for(k in a)a.hasOwnProperty(k)&&(h[k]=a[k]);a.arguments=[];a.thisProgram="./this.program";a.quit=function(b,c){throw c;};a.preRun=[];a.postRun=[];var l=!1,n=!1,p=!1,q=!1;l="object"===typeof window;n="function"===typeof importScripts;p="object"===typeof process&&"function"===typeof require&&!l&&!n;q=!l&&!p&&!n;var r="";function t(b){return a.locateFile?a.locateFile(b,r):r+b}
if(p){r=__dirname+"/";var u,v;a.read=function(b,c){var d=x(b);d||(u||(u=require("fs")),v||(v=require("path")),b=v.normalize(b),d=u.readFileSync(b));return c?d:d.toString()};a.readBinary=function(b){b=a.read(b,!0);b.buffer||(b=new Uint8Array(b));assert(b.buffer);return b};1<process.argv.length&&(a.thisProgram=process.argv[1].replace(/\\/g,"/"));a.arguments=process.argv.slice(2);process.on("uncaughtException",function(b){throw b;});process.on("unhandledRejection",y);a.quit=function(b){process.exit(b)};
a.inspect=function(){return"[Emscripten Module object]"}}else if(q)"undefined"!=typeof read&&(a.read=function(b){var c=x(b);return c?z(c):read(b)}),a.readBinary=function(b){var c;if(c=x(b))return c;if("function"===typeof readbuffer)return new Uint8Array(readbuffer(b));c=read(b,"binary");assert("object"===typeof c);return c},"undefined"!=typeof scriptArgs?a.arguments=scriptArgs:"undefined"!=typeof arguments&&(a.arguments=arguments),"function"===typeof quit&&(a.quit=function(b){quit(b)});else if(l||
n)n?r=self.location.href:document.currentScript&&(r=document.currentScript.src),_scriptDir&&(r=_scriptDir),0!==r.indexOf("blob:")?r=r.substr(0,r.lastIndexOf("/")+1):r="",a.read=function(b){try{var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText}catch(d){if(b=x(b))return z(b);throw d;}},n&&(a.readBinary=function(b){try{var c=new XMLHttpRequest;c.open("GET",b,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}catch(d){if(b=x(b))return b;throw d;
}}),a.readAsync=function(b,c,d){var e=new XMLHttpRequest;e.open("GET",b,!0);e.responseType="arraybuffer";e.onload=function(){if(200==e.status||0==e.status&&e.response)c(e.response);else{var f=x(b);f?c(f.buffer):d()}};e.onerror=d;e.send(null)},a.setWindowTitle=function(b){document.title=b};
var A=a.print||("undefined"!==typeof console?console.log.bind(console):"undefined"!==typeof print?print:null),B=a.printErr||("undefined"!==typeof printErr?printErr:"undefined"!==typeof console&&console.warn.bind(console)||A);for(k in h)h.hasOwnProperty(k)&&(a[k]=h[k]);h=void 0;function C(b){var c;c||(c=16);return Math.ceil(b/c)*c}var aa={"f64-rem":function(b,c){return b%c},"debugger":function(){debugger}},D=!1;function assert(b,c){b||y("Assertion failed: "+c)}"undefined"!==typeof TextDecoder&&new TextDecoder("utf8");
"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");function E(b,c){0<b%c&&(b+=c-b%c);return b}var buffer,F,G,H;function I(){a.HEAP8=F=new Int8Array(buffer);a.HEAP16=new Int16Array(buffer);a.HEAP32=H=new Int32Array(buffer);a.HEAPU8=G=new Uint8Array(buffer);a.HEAPU16=new Uint16Array(buffer);a.HEAPU32=new Uint32Array(buffer);a.HEAPF32=new Float32Array(buffer);a.HEAPF64=new Float64Array(buffer)}var J,K,L,M,N,O,P;J=K=L=M=N=O=P=0;
a.reallocBuffer||(a.reallocBuffer=function(b){try{var c=F;var d=new ArrayBuffer(b);(new Int8Array(d)).set(c)}catch(e){return!1}return ba(d)?d:!1});var Q;try{Q=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),Q(new ArrayBuffer(4))}catch(b){Q=function(c){return c.byteLength}}var R=a.TOTAL_STACK||65536,S=a.TOTAL_MEMORY||1048576;S<R&&B("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+S+"! (TOTAL_STACK="+R+")");
a.buffer?buffer=a.buffer:("object"===typeof WebAssembly&&"function"===typeof WebAssembly.Memory?(a.wasmMemory=new WebAssembly.Memory({initial:S/65536}),buffer=a.wasmMemory.buffer):buffer=new ArrayBuffer(S),a.buffer=buffer);I();function T(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c();else{var d=c.u;"number"===typeof d?void 0===c.m?a.dynCall_v(d):a.dynCall_vi(d,c.m):d(void 0===c.m?null:c.m)}}}var ca=[],da=[],ea=[],fa=[],ha=!1;function ia(){var b=a.preRun.shift();ca.unshift(b)}
var U=0,V=null,W=null;a.preloadedImages={};a.preloadedAudios={};var X="data:application/octet-stream;base64,";function Y(b){return String.prototype.startsWith?b.startsWith(X):0===b.indexOf(X)}
(function(){function b(){try{if(a.wasmBinary)return new Uint8Array(a.wasmBinary);var b=x(f);if(b)return b;if(a.readBinary)return a.readBinary(f);throw"both async and sync fetching of the wasm failed";}catch(ka){y(ka)}}function c(){return a.wasmBinary||!l&&!n||"function"!==typeof fetch?new Promise(function(c){c(b())}):fetch(f,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+f+"'";return b.arrayBuffer()}).catch(function(){return b()})}function d(b){function d(b){w=
b.exports;if(w.memory){b=w.memory;var c=a.buffer;b.byteLength<c.byteLength&&B("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here");c=new Int8Array(c);(new Int8Array(b)).set(c);a.buffer=buffer=b;I()}a.asm=w;a.usingWasm=!0;U--;a.monitorRunDependencies&&a.monitorRunDependencies(U);0==U&&(null!==V&&(clearInterval(V),V=null),W&&(b=W,W=null,b()))}function e(b){d(b.instance)}function g(b){c().then(function(b){return WebAssembly.instantiate(b,m)}).then(b,
function(b){B("failed to asynchronously prepare wasm: "+b);y(b)})}if("object"!==typeof WebAssembly)return B("no native wasm support detected"),!1;if(!(a.wasmMemory instanceof WebAssembly.Memory))return B("no native wasm Memory in use"),!1;b.memory=a.wasmMemory;m.global={NaN:NaN,Infinity:Infinity};m["global.Math"]=Math;m.env=b;U++;a.monitorRunDependencies&&a.monitorRunDependencies(U);if(a.instantiateWasm)try{return a.instantiateWasm(m,d)}catch(la){return B("Module.instantiateWasm callback failed with error: "+
la),!1}a.wasmBinary||"function"!==typeof WebAssembly.instantiateStreaming||Y(f)||"function"!==typeof fetch?g(e):WebAssembly.instantiateStreaming(fetch(f,{credentials:"same-origin"}),m).then(e,function(b){B("wasm streaming compile failed: "+b);B("falling back to ArrayBuffer instantiation");g(e)});return{}}var e="",f="data:application/octet-stream;base64,AGFzbQEAAAABRgpgAAF/YAF/AGADf39/AX9gAX8Bf2AFf39/f38Bf2AGf39/f39/AX9gBH9/f38Bf2AEf39/fwBgBn9/f39/fwBgAn9/AX8CSQgDZW52AWMAAQNlbnYBZAACA2VudgFlAAADZW52AWYAAANlbnYBZwAAA2VudgFhA38AA2VudgFiA38AA2VudgZtZW1vcnkCABADExIHBwkIAwIBAwkCBgUEAAEDAwQGCwJ/ASMAC38BIwELBxUFAWgAEgFpABMBagAUAWsAFgFsABEKkS0SMAEBfyADKAIAIgRBA3QgAGogATYCACAEQQN0IABqIAI2AgQgAyAEQQFqQQ9xNgIACyMBAX8gAigCACIEQQJ0IABqIAE2AgAgAiADIARqQQ9xNgIACxkBAX8gASAAEBUiAkEBdkEAIAJBAXFrc2oLZQAgAkECRgRAIAFBAXQgAGogAzsBACABQQFqQQF0IABqIAQ7AQAgAUECakEBdCAAaiAFOwEABSABQQJ0IABqIAM2AgAgAUEBakECdCAAai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AtBARAGIAUgAyAJIAwQBSAFIAYgAyAMEAUFIAAgDiACIAYgCSAEIAsoAgBBDyAIa2pBD3FBAnQgB2ooAgAgCkUiChsiCBAIIAcgCCALIAoQBiAFIAggCSAMEAUgBSAGIAggDBAFIAQgCmohBAsFAn8gCUH/AXFB/gFIBEAgEiAIQQ9xai0AACIJQQR2IghFIQYgACAOIAIgBCAEQQFqIgogCygCACIPIAhrQQ9xQQJ0IAdqKAIAIAYbIgggBiAKaiITIA8gCWtBD3FBAnQgB2ooAgAgCUEPcUUiChsiCRAIIAcgBCALQQEQBiAHIAggCyAGEAYgByAJIAsgChAGIAUgCCAEIAwQBSAFIAkgCCAMEAUgBSAEIAkgDBAFIAogE2oMAQsgDSAGQQFqNgIAIAQgCUF+RiITaiEIIAYtAAAiCkEEdiIPRSIUBEAgCEEBaiEGBSAIIQYgCygCACAPa0EPcUECdCAHaigCACEICyAKQQ9xIhVFIhYEQCAGQQFqIQkFIAYhCSALKAIAIAprQQ9xQQJ0IAdqKAIAIQYLIBNFBEAgDSADEAciAyEECyAPQQ9GIgoEQCANIAMQByIDIQgLIBVBD0YiDwRAIA0gAxAHIgMhBgsgACAOIAIgBCAIIAYQCCAHIAQgC0EBEAYgByAIIAsgCiAUckEBcRAGIAcgBiALIA8gFnJBAXEQBiAFIAggBCAMEAUgBSAGIAggDBAFIAUgBCAGIAwQBSAJCyEECyARQQFqIREgDSgCACEGIA5BA2oiDiABSQ0ACwwBCwwBC0EAQX0gBiASRhshAAsFQX8hAAsLIBAkAyAACw==",g="";Y(e)||(e=t(e));Y(f)||
(f=t(f));Y(g)||(g=t(g));var m={global:null,env:null,asm2wasm:aa,parent:a},w=null;a.asmPreload=a.asm;var ma=a.reallocBuffer;a.reallocBuffer=function(b){if("asmjs"===na)var c=ma(b);else a:{b=E(b,a.usingWasm?65536:16777216);var d=a.buffer.byteLength;if(a.usingWasm)try{c=-1!==a.wasmMemory.grow((b-d)/65536)?a.buffer=a.wasmMemory.buffer:null;break a}catch(sa){c=null;break a}c=void 0}return c};var na="";a.asm=function(b,c){if(!c.table){b=a.wasmTableSize;void 0===b&&(b=1024);var e=a.wasmMaxTableSize;c.table=
"object"===typeof WebAssembly&&"function"===typeof WebAssembly.Table?void 0!==e?new WebAssembly.Table({initial:b,maximum:e,element:"anyfunc"}):new WebAssembly.Table({initial:b,element:"anyfunc"}):Array(b);a.wasmTable=c.table}c.__memory_base||(c.__memory_base=a.STATIC_BASE);c.__table_base||(c.__table_base=0);c=d(c);assert(c,"no binaryen method succeeded.");return c}})();J=1024;K=J+1168;da.push();a.STATIC_BASE=J;a.STATIC_BUMP=1168;var ja=K+=16;K=K+4+15&-16;P=ja;L=M=C(K);N=L+R;O=C(N);H[P>>2]=O;
var oa=!1;function z(b){for(var c=[],d=0;d<b.length;d++){var e=b[d];255<e&&(oa&&assert(!1,"Character code "+e+" ("+String.fromCharCode(e)+") at offset "+d+" not in 0x00-0xFF."),e&=255);c.push(String.fromCharCode(e))}return c.join("")}
var pa="function"===typeof atob?atob:function(b){var c="",d=0;b=b.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d++));var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d++));var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d++));var m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d++));e=e<<2|f>>4;
f=(f&15)<<4|g>>2;var w=(g&3)<<6|m;c+=String.fromCharCode(e);64!==g&&(c+=String.fromCharCode(f));64!==m&&(c+=String.fromCharCode(w))}while(d<b.length);return c};
function x(b){if(Y(b)){b=b.slice(X.length);if("boolean"===typeof p&&p){try{var c=Buffer.from(b,"base64")}catch(g){c=new Buffer(b,"base64")}var d=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}else try{var e=pa(b),f=new Uint8Array(e.length);for(c=0;c<e.length;++c)f[c]=e.charCodeAt(c);d=f}catch(g){throw Error("Converting base64 string to bytes failed.");}return d}}a.wasmTableSize=0;a.wasmMaxTableSize=0;a.o={};
a.s={g:function(){var b=a.usingWasm?65536:16777216,c=2147483648-b;if(H[P>>2]>c)return!1;var d=S;for(S=Math.max(S,16777216);S<H[P>>2];)536870912>=S?S=E(2*S,b):S=Math.min(E((3*S+2147483648)/4,b),c);b=a.reallocBuffer(S);if(!b||b.byteLength!=S)return S=d,!1;a.buffer=buffer=b;I();return!0},f:function(){return S},e:function(){y("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+S+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")},
c:function(b){a.___errno_location&&(H[a.___errno_location()>>2]=b);return b},d:function(b,c,d){G.set(G.subarray(c,c+d),b);return b},a:P,b:M};var qa=a.asm(a.o,a.s,buffer);a.asm=qa;a.___errno_location=function(){return a.asm.h.apply(null,arguments)};var ba=a._emscripten_replace_memory=function(){return a.asm._emscripten_replace_memory.apply(null,arguments)};a._free=function(){return a.asm.i.apply(null,arguments)};a._malloc=function(){return a.asm.j.apply(null,arguments)};
a._meshopt_decodeIndexBuffer=function(){return a.asm.k.apply(null,arguments)};a._meshopt_decodeVertexBuffer=function(){return a.asm.l.apply(null,arguments)};a.asm=qa;a.then=function(b){if(a.calledRun)b(a);else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();b(a)}}return a};W=function ra(){a.calledRun||Z();a.calledRun||(W=ra)};
function Z(){function b(){if(!a.calledRun&&(a.calledRun=!0,!D)){ha||(ha=!0,T(da));T(ea);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var b=a.postRun.shift();fa.unshift(b)}T(fa)}}if(!(0<U)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)ia();T(ca);0<U||a.calledRun||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);
b()},1)):b())}}a.run=Z;function y(b){if(a.onAbort)a.onAbort(b);void 0!==b?(A(b),B(b),b=JSON.stringify(b)):b="";D=!0;throw"abort("+b+"). Build with -s ASSERTIONS=1 for more info.";}a.abort=y;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();a.noExitRuntime=!0;Z();
a.decodeVertexBuffer=function(b,c,d,e){var f=a._malloc(c*d),g=a._malloc(e.length);a.HEAPU8.set(e,g);e=a._meshopt_decodeVertexBuffer(f,c,d,g,e.length);b.set(a.HEAPU8.subarray(f,f+c*d),0);a._free(g);a._free(f);if(0!=e)throw Error("Malformed vertex buffer data");};
a.decodeIndexBuffer=function(b,c,d,e){var f=a._malloc(c*d),g=a._malloc(e.length);a.HEAPU8.set(e,g);e=a._meshopt_decodeIndexBuffer(f,c,d,g,e.length);b.set(a.HEAPU8.subarray(f,f+c*d),0);a._free(g);a._free(f);if(0!=e)throw Error("Malformed index buffer data");};
return MeshoptDecoder;
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = MeshoptDecoder;
else if (typeof define === 'function' && define['amd'])
define([], function() { return MeshoptDecoder; });
else if (typeof exports === 'object')
exports["MeshoptDecoder"] = MeshoptDecoder;