var WebGLAdapterModule = (function() { var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; return ( function(WebGLAdapterModule) { WebGLAdapterModule = WebGLAdapterModule || {}; var Module=typeof WebGLAdapterModule!=="undefined"?WebGLAdapterModule:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,"maximum":2147483648/WASM_PAGE_SIZE})}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}function hasPrefix(str,prefix){return String.prototype.startsWith?str.startsWith(prefix):str.indexOf(prefix)===0}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return hasPrefix(filename,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(filename){return hasPrefix(filename,fileURIPrefix)}var wasmBinaryFile="WebGLAdapterModule.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return Promise.resolve().then(getBinary)}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["d"];removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiatedSource(output){receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _abort(){abort()}function _emscripten_get_heap_size(){return HEAPU8.length}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){requestedSize=requestedSize>>>0;var oldSize=_emscripten_get_heap_size();var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}var minHeapSize=16777216;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(minHeapSize,requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}__ATINIT__.push({func:function(){___wasm_call_ctors()}});var asmLibraryArg={"c":_abort,"b":_emscripten_resize_heap,"a":wasmMemory};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["e"]).apply(null,arguments)};var _NewFloatArray=Module["_NewFloatArray"]=function(){return(_NewFloatArray=Module["_NewFloatArray"]=Module["asm"]["f"]).apply(null,arguments)};var _DeleteFloatArray=Module["_DeleteFloatArray"]=function(){return(_DeleteFloatArray=Module["_DeleteFloatArray"]=Module["asm"]["g"]).apply(null,arguments)};var _GetNormalizedVertexArray=Module["_GetNormalizedVertexArray"]=function(){return(_GetNormalizedVertexArray=Module["_GetNormalizedVertexArray"]=Module["asm"]["h"]).apply(null,arguments)};var _NormalizeVertexArray=Module["_NormalizeVertexArray"]=function(){return(_NormalizeVertexArray=Module["_NormalizeVertexArray"]=Module["asm"]["i"]).apply(null,arguments)};var _NewUintArray=Module["_NewUintArray"]=function(){return(_NewUintArray=Module["_NewUintArray"]=Module["asm"]["j"]).apply(null,arguments)};var _DeleteUintArray=Module["_DeleteUintArray"]=function(){return(_DeleteUintArray=Module["_DeleteUintArray"]=Module["asm"]["k"]).apply(null,arguments)};var _GetElementsArray=Module["_GetElementsArray"]=function(){return(_GetElementsArray=Module["_GetElementsArray"]=Module["asm"]["l"]).apply(null,arguments)};var _Triangulation=Module["_Triangulation"]=function(){return(_Triangulation=Module["_Triangulation"]=Module["asm"]["m"]).apply(null,arguments)};var _ListWLine=Module["_ListWLine"]=function(){return(_ListWLine=Module["_ListWLine"]=Module["asm"]["n"]).apply(null,arguments)};var _FillLineElement=Module["_FillLineElement"]=function(){return(_FillLineElement=Module["_FillLineElement"]=Module["asm"]["o"]).apply(null,arguments)};var _ListCircle=Module["_ListCircle"]=function(){return(_ListCircle=Module["_ListCircle"]=Module["asm"]["p"]).apply(null,arguments)};var _FillCircleElement=Module["_FillCircleElement"]=function(){return(_FillCircleElement=Module["_FillCircleElement"]=Module["asm"]["q"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["r"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["s"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["t"]).apply(null,arguments)};Module["ccall"]=ccall;Module["cwrap"]=cwrap;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}noExitRuntime=true;run();Module["getNormalizedVertexArray"]=function(width,height){var vertexBufferptr=Module.ccall("NewFloatArray","number",["number"],[width*height*2]);Module.ccall("GetNormalizedVertexArray","null",["number","number","number"],[vertexBufferptr,width,height]);return{module:this,ptr:vertexBufferptr,bufferSize:width*height*2,getBuffer:function(){return new Float32Array(this.module.HEAPF32.buffer,this.ptr,this.bufferSize)},destroy:function(){this.module.ccall("DeleteFloatArray","null",["number"],[this.ptr]);this.module=null;this.ptr=0;this.bufferSize=0;this.getBuffer=function(){};this.destroy=function(){}}}};Module["getElementsArray"]=function(width,height){var elementsBufferptr=Module.ccall("NewUintArray","number",["number"],[width*height+(width-1)*(height-2)]);Module.ccall("GetElementsArray","null",["number","number","number"],[elementsBufferptr,width,height]);return{module:this,ptr:elementsBufferptr,bufferSize:width*height+(width-1)*(height-2),getBuffer:function(){return new Uint32Array(this.module.HEAPU32.buffer,this.ptr,this.bufferSize)},destroy:function(){this.module.ccall("DeleteUintArray","null",["number"],[this.ptr]);this.module=null;this.ptr=0;this.bufferSize=0;this.getBuffer=function(){};this.destroy=function(){}}}};Module["getPolygonArray"]=function(points,width,height,lineWidth,filled){var vertexSize=points.length;var vertexPtr=Module.ccall("NewFloatArray","number",["number"],[vertexSize]);this.HEAPF32.set(points,vertexPtr/4);var lineVertexPtr=0;var lineVertexSize=0;var lineElementPtr=0;var lineElementSize=0;if(lineWidth>1){lineVertexSize=(vertexSize-2)*4;lineVertexPtr=Module.ccall("NewFloatArray","number",["number"],[lineVertexSize]);Module.ccall("ListWLine","number",["number","number","number","number","boolean"],[lineVertexPtr,vertexPtr,vertexSize,lineWidth,true]);Module.ccall("NormalizeVertexArray","null",["number","number","number","number"],[lineVertexPtr,lineVertexSize,width,height]);lineElementSize=lineVertexSize*3/4;lineElementPtr=Module.ccall("NewUintArray","number",["number"],[lineElementSize]);Module.ccall("FillLineElement","null",["number","number"],[lineElementPtr,lineVertexSize/2])}Module.ccall("NormalizeVertexArray","null",["number","number","number","number"],[vertexPtr,vertexSize,width,height]);var fillIndexPtr=0;var fillIndexSize=0;if(filled){var edgeCount=points.length/2-1;fillIndexSize=(edgeCount-2)*3;fillIndexPtr=Module.ccall("NewUintArray","number",["number"],[fillIndexSize]);if(Module.ccall("Triangulation","boolean",["number","number","number"],[fillIndexPtr,vertexPtr,edgeCount])==false){Module.ccall("DeleteUintArray","null",["number"],[fillIndexPtr]);fillIndexPtr=0;fillIndexSize=0}}return{module:this,vertexPtr:vertexPtr,vertexSize:vertexSize,getVertexBuffer:function(){return new Float32Array(this.module.HEAPF32.buffer,this.vertexPtr,this.vertexSize)},fillIndexPtr:fillIndexPtr,fillIndexSize:fillIndexSize,getFillIndexBuffer:function(){return new Uint32Array(this.module.HEAPU32.buffer,this.fillIndexPtr,this.fillIndexSize)},lineVertexPtr:lineVertexPtr,lineVertexSize:lineVertexSize,getLineVertexBuffer:function(){return new Float32Array(this.module.HEAPF32.buffer,this.lineVertexPtr,this.lineVertexSize)},lineElementPtr:lineElementPtr,lineElementSize:lineElementSize,getLineElementBuffer:function(){return new Uint32Array(this.module.HEAPU32.buffer,this.lineElementPtr,this.lineElementSize)},destroy:function(){if(this.vertexbufferSize>0){this.module.ccall("DeleteFloatArray","null",["number"],[this.vertexPtr]);this.vertexPtr=0;this.vertexSize=0}if(this.fillIndexSize>0){this.module.ccall("DeleteUintArray","null",["number"],[this.fillIndexPtr]);this.fillIndexPtr=0;this.fillIndexSize=0}if(this.lineElementbufferSize>0){this.module.ccall("DeleteUintArray","null",["number"],[this.lineElementPtr]);this.lineElementPtr=0;this.lineElementbufferSize=0}if(this.lineVertexSize>0){this.module.ccall("DeleteFloatArray","null",["number"],[this.lineVertexPtr]);this.lineVertexPtr=0;this.lineVertexSize=0}this.module=null;this.getVertexBuffer=function(){};this.getFillIndexBuffer=function(){};this.getLineVertexBuffer=function(){};this.destroy=function(){}}}};Module["getCircleArray"]=function(centerX,centerY,radius,width,height,quality,lineWidth,filled){var vertexSize=(quality+1)*2;var vertexPtr=Module.ccall("NewFloatArray","number",["number"],[vertexSize]);Module.ccall("ListCircle","number",["number","number","number","number","number","number"],[vertexPtr,centerX,centerY,radius,quality,1]);var lineVertexPtr=0;var lineVertexSize=0;var lineElementPtr=0;var lineElementSize=0;if(lineWidth>1){lineVertexSize=vertexSize*2;lineVertexPtr=Module.ccall("NewFloatArray","number",["number"],[lineVertexSize]);Module.ccall("ListCircle","number",["number","number","number","number","number","number"],[lineVertexPtr,centerX,centerY,radius,quality,lineWidth]);Module.ccall("NormalizeVertexArray","null",["number","number","number","number"],[lineVertexPtr,lineVertexSize,width,height]);lineElementSize=vertexSize;lineElementPtr=Module.ccall("NewUintArray","number",["number"],[lineElementSize]);Module.ccall("FillCircleElement","null",["number","number"],[lineElementPtr,vertexSize])}Module.ccall("NormalizeVertexArray","null",["number","number","number","number"],[vertexPtr,vertexSize,width,height]);var fillIndexPtr=0;var fillIndexSize=0;if(filled){var edgeCount=quality;fillIndexSize=(edgeCount-2)*3;fillIndexPtr=Module.ccall("NewUintArray","number",["number"],[fillIndexSize]);if(Module.ccall("Triangulation","boolean",["number","number","number"],[fillIndexPtr,vertexPtr,edgeCount])==false){Module.ccall("DeleteUintArray","null",["number"],[fillIndexPtr]);fillIndexPtr=0;fillIndexSize=0}}return{module:this,vertexPtr:vertexPtr,vertexSize:vertexSize,getVertexBuffer:function(){return new Float32Array(this.module.HEAPF32.buffer,this.vertexPtr,this.vertexSize)},fillIndexPtr:fillIndexPtr,fillIndexSize:fillIndexSize,getFillIndexBuffer:function(){return new Uint32Array(this.module.HEAPU32.buffer,this.fillIndexPtr,this.fillIndexSize)},lineVertexPtr:lineVertexPtr,lineVertexSize:lineVertexSize,getLineVertexBuffer:function(){return new Float32Array(this.module.HEAPF32.buffer,this.lineVertexPtr,this.lineVertexSize)},lineElementPtr:lineElementPtr,lineElementSize:lineElementSize,getLineElementBuffer:function(){return new Uint32Array(this.module.HEAPU32.buffer,this.lineElementPtr,this.lineElementSize)},destroy:function(){if(this.vertexbufferSize>0){this.module.ccall("DeleteFloatArray","null",["number"],[this.vertexPtr]);this.vertexPtr=0;this.vertexSize=0}if(this.fillIndexSize>0){this.module.ccall("DeleteUintArray","null",["number"],[this.fillIndexPtr]);this.fillIndexPtr=0;this.fillIndexSize=0}if(this.lineElementbufferSize>0){this.module.ccall("DeleteUintArray","null",["number"],[this.lineElementPtr]);this.lineElementPtr=0;this.lineElementbufferSize=0}if(this.lineVertexSize>0){this.module.ccall("DeleteFloatArray","null",["number"],[this.lineVertexPtr]);this.lineVertexPtr=0;this.lineVertexSize=0}this.module=null;this.getVertexBuffer=function(){};this.getFillIndexBuffer=function(){};this.getLineVertexBuffer=function(){};this.destroy=function(){}}}};Module["getIdentityMatrix"]=function(){function MultiplyMatrices4x4(matA,matB){var result=new Float32Array(16);result[0]=matA[0]*matB[0]+matA[1]*matB[4]+matA[2]*matB[8]+matA[3]*matB[12];result[1]=matA[0]*matB[1]+matA[1]*matB[5]+matA[2]*matB[9]+matA[3]*matB[13];result[2]=0;result[3]=0;result[4]=matA[4]*matB[0]+matA[5]*matB[4]+matA[6]*matB[8]+matA[7]*matB[12];result[5]=matA[4]*matB[1]+matA[5]*matB[5]+matA[6]*matB[9]+matA[7]*matB[13];result[6]=0;result[7]=0;result[8]=0;result[9]=0;result[10]=matA[8]*matB[2]+matA[9]*matB[6]+matA[10]*matB[10]+matA[11]*matB[14];result[11]=0;result[12]=matA[12]*matB[0]+matA[13]*matB[4]+matA[14]*matB[8]+matA[15]*matB[12];result[13]=matA[12]*matB[1]+matA[13]*matB[5]+matA[14]*matB[9]+matA[15]*matB[13];result[14]=0;result[15]=1;return result}var PIdivide180=Math.PI/180;var matrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);matrix.translate=function(x,y,width,height){var translateMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,x*2/width,y*-2/height,0,1]);this.set(MultiplyMatrices4x4(this,translateMatrix))};matrix.rotate=function(angle,width,height){var radian=angle*PIdivide180;var sinR=Math.sin(radian);var cosR=Math.cos(radian);var rotateMatrix=[cosR,-sinR*(width/height),0,0,sinR*(height/width),cosR,0,0,0,0,1,0,0,0,0,1];this.set(MultiplyMatrices4x4(this,rotateMatrix))};matrix.scale=function(x,y){var scaleMatrix=new Float32Array([x,0,0,0,0,y,0,0,0,0,1,0,0,0,0,1]);this.set(MultiplyMatrices4x4(this,scaleMatrix))};return matrix}; return WebGLAdapterModule.ready } ); })(); if (typeof exports === 'object' && typeof module === 'object') module.exports = WebGLAdapterModule; else if (typeof define === 'function' && define['amd']) define([], function() { return WebGLAdapterModule; }); else if (typeof exports === 'object') exports["WebGLAdapterModule"] = WebGLAdapterModule;