mirror of
https://gitlab.com/skysthelimit.dev/selenite.git
synced 2025-06-15 18:12:08 -05:00
118 lines
5.4 KiB
HTML
118 lines
5.4 KiB
HTML
<!doctype html>
|
|
<html lang="en-us">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Unity WebGL Player | AdVenture Capitalist!</title>
|
|
<link rel="stylesheet" href="TemplateData/style.css">
|
|
<script src="TemplateData/UnityProgress.js"></script>
|
|
</head>
|
|
|
|
<body class="template">
|
|
<script src="/js/all.js"></script>
|
|
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" height="100%" width="100%"></canvas>
|
|
<div id="loadingBox">
|
|
<div id="bgBar"></div>
|
|
<div id="progressBar"></div>
|
|
<p id="loadingInfo">Loading...</p>
|
|
</div>
|
|
<script type='text/javascript'>
|
|
alert('Want to go to the old Adventure Capitalist? Just add "old" to the end of the url.');
|
|
// connect to canvas
|
|
var Module = {
|
|
TOTAL_MEMORY: 201326592,
|
|
filePackagePrefixURL: "https://rawcdn.githack.com/EmulatorOS/gfile/a353d35ac44f2c72439d6d765636765f0fd9b0f0/adcap/Release/",
|
|
memoryInitializerPrefixURL: "https://rawcdn.githack.com/EmulatorOS/gfile/a353d35ac44f2c72439d6d765636765f0fd9b0f0/adcap/Release/",
|
|
preRun: [],
|
|
postRun: [],
|
|
print: (function() {
|
|
return function(text) {
|
|
console.log(text);
|
|
};
|
|
})(),
|
|
printErr: function(text) {
|
|
console.error(text);
|
|
},
|
|
canvas: document.getElementById('canvas'),
|
|
progress: null,
|
|
setStatus: function(text) {
|
|
if (this.progress == null) {
|
|
if (typeof UnityProgress != 'function')
|
|
return;
|
|
this.progress = new UnityProgress(canvas);
|
|
}
|
|
if (!Module.setStatus.last) Module.setStatus.last = {
|
|
time: Date.now(),
|
|
text: ''
|
|
};
|
|
if (text === Module.setStatus.text) return;
|
|
this.progress.SetMessage(text);
|
|
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
|
|
if (m)
|
|
this.progress.SetProgress(parseInt(m[2]) / parseInt(m[4]));
|
|
if (text === "")
|
|
this.progress.Clear()
|
|
},
|
|
totalDependencies: 0,
|
|
monitorRunDependencies: function(left) {
|
|
this.totalDependencies = Math.max(this.totalDependencies, left);
|
|
Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies - left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
|
|
}
|
|
};
|
|
Module.setStatus('Downloading (0.0/1)');
|
|
</script>
|
|
<script src="https://cdn.jsdelivr.net/gh/EmulatorOS/gfile@main/adcap/Release/UnityConfig.js"></script>
|
|
<script src="https://cdn.jsdelivr.net/gh/EmulatorOS/gfile@main/adcap/Release/fileloader.js"></script>
|
|
<script>
|
|
if (!(!Math.fround)) {
|
|
var script = document.createElement('script');
|
|
script.src = "https://rawcdn.githack.com/EmulatorOS/gfile/a353d35ac44f2c72439d6d765636765f0fd9b0f0/adcap/Release/webgl.js";
|
|
document.body.appendChild(script);
|
|
} else {
|
|
var codeXHR = new XMLHttpRequest();
|
|
codeXHR.open('GET', 'https://rawcdn.githack.com/EmulatorOS/gfile/a353d35ac44f2c72439d6d765636765f0fd9b0f0/adcap/Release/webgl.js', true);
|
|
codeXHR.onload = function() {
|
|
var code = codeXHR.responseText;
|
|
if (!Math.fround) {
|
|
try {
|
|
console.log('optimizing out Math.fround calls');
|
|
var m = /var ([^=]+)=global\.Math\.fround;/.exec(code);
|
|
var minified = m[1];
|
|
if (!minified) throw 'fail';
|
|
var startAsm = code.indexOf('// EMSCRIPTEN_START_FUNCS');
|
|
var endAsm = code.indexOf('// EMSCRIPTEN_END_FUNCS');
|
|
var asm = code.substring(startAsm, endAsm);
|
|
do {
|
|
var moar = false; // we need to re-do, as x(x( will not be fixed
|
|
asm = asm.replace(new RegExp('[^a-zA-Z0-9\\$\\_]' + minified + '\\(', 'g'), function(s) {
|
|
moar = true;
|
|
return s[0] + '('
|
|
});
|
|
} while (moar);
|
|
code = code.substring(0, startAsm) + asm + code.substring(endAsm);
|
|
code = code.replace("'use asm'", "'almost asm'");
|
|
} catch (e) {
|
|
console.log('failed to optimize out Math.fround calls ' + e)
|
|
}
|
|
}
|
|
var blob = new Blob([code], {
|
|
type: 'text/javascript'
|
|
});
|
|
codeXHR = null;
|
|
var src = URL.createObjectURL(blob);
|
|
var script = document.createElement('script');
|
|
script.src = URL.createObjectURL(blob);
|
|
script.onload = function() {
|
|
URL.revokeObjectURL(script.src);
|
|
};
|
|
document.body.appendChild(script);
|
|
};
|
|
codeXHR.send(null);
|
|
}
|
|
</script>
|
|
<script src="97c35fd0-ea33-4844-a283-b7a4c6942643" id="c4174e706ac02e24f4101391e93a5db9"></script>
|
|
</body>
|
|
|
|
</html>
|