nzp-team.github.io/ftewebgl.js

2 lines
162 KiB
JavaScript
Raw Normal View History

2024-09-12 08:21:47 +00:00
var Module=typeof Module!="undefined"?Module:{};FTEH={h:[],f:{}};FTE_SW=null;if(!Module["canvas"]){Module["canvas"]=document.getElementById("canvas");if(!Module["canvas"]){console.log("No canvas element defined yet.");Module.canvas=document.createElement("canvas");Module.canvas.style.width="100%";Module.canvas.style.height="100%";document.body.appendChild(Module["canvas"])}}Module["loadcachedfiles"]=function(){addRunDependency("loadcachedfiles");try{caches.open("user").then(c=>{Module["cache"]=c;return c.keys()}).then(keys=>{const cache=Module["cache"];for(var r of keys){const idx=r.url.indexOf("/_/");if(idx<0)continue;const fn=r.url.substr(idx+3);addRunDependency(fn);const response=cache.match(r).then(response=>{return response.arrayBuffer()}).then(buffer=>{let b=FTEH.h[_emscriptenfte_buf_createfromarraybuf(buffer)];b.n=fn;FTEH.f[b.n]=b}).finally(()=>{removeRunDependency(fn)})}}).finally(()=>{removeRunDependency("loadcachedfiles")})}catch(e){removeRunDependency("loadcachedfiles")}};Module["preRun"]=Module["loadcachedfiles"];if(typeof Module["files"]!=="undefined"&&Object.keys(Module["files"]).length>0){Module["preRun"]=function(){Module["loadcachedfiles"]();Module["curfile"]=undefined;let files=Module["files"];let names=Object.keys(files);for(let i=0;i<names.length;i++){let ab=files[names[i]];let n=names[i];if(typeof ab=="string"){addRunDependency(n);let xhr=new XMLHttpRequest;xhr.responseType="arraybuffer";xhr.open("GET",ab);xhr.onload=function(){if(Module["curfile"]==n)Module["curfile"]=undefined;if(this.status>=200&&this.status<300){let b=FTEH.h[_emscriptenfte_buf_createfromarraybuf(this.response)];b.n=n;FTEH.f[b.n]=b;removeRunDependency(n)}else removeRunDependency(n)};xhr.onprogress=function(e){if(typeof Module["curfile"]=="undefined")Module["curfile"]=n;if(Module["setStatus"]&&Module["curfile"]==n)Module["setStatus"](n+" ("+e.loaded+"/"+e.total+")")};xhr.onerror=function(){if(Module["curfile"]==n)Module["curfile"]=undefined;removeRunDependency(n)};xhr.send()}else if(typeof ab.then=="function"){addRunDependency(n);ab.then(value=>{let b=FTEH.h[_emscriptenfte_buf_createfromarraybuf(value)];b.n=n;FTEH.f[b.n]=b;removeRunDependency(n)},reason=>{console.log(reason);removeRunDependency(n)})}else{let b=FTEH.h[_emscriptenfte_buf_createfromarraybuf(ab)];b.n=n;FTEH.f[b.n]=b}}}}else if(!Module["manifest"]){let man=window.location.protocol+"//"+window.location.host+window.location.pathname;if(man.substr(-1)!="/")man+=".fmf";else man+="index.fmf";Module["manifest"]=man;if(window.location.hash!="")Module["manifest"]=window.location.hash.substring(1)}if(!Module["arguments"]){Module["arguments"]=[];const qstrings=decodeURIComponent(window.location.search.substring(1));if(qstrings!=""){const qstring=qstrings.split(" ");for(let i=0;i<qstring.length;i++){if(qstring[i]=="-manifest")man=undefined;if((qstring[i]=="+sv_port_rtc"||qstring[i]=="+connect"||qstring[i]=="+join"||qstring[i]=="+observe"||qstring[i]=="+qtvplay")&&i+1<qstring.length){Module["arguments"]=Module["arguments"].concat(qstring[i+0],qstring[i+1]);i++}else if(!document.referrer)Module["arguments"]=Module["arguments"].concat(qstring[i])}}if(Module["manifest"]!=undefined)Module["arguments"]=Module["arguments"].concat(["-manifest",Module["manifest"]]);Module["mayregisterscemes"]=true}var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}var fs;var nodePath;var requireNodeFS;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").d