2014-08-25 07:35:41 +00:00
<!doctype html>
< html lang = "en-us" >
< head >
< meta charset = "utf-8" >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" >
2014-09-02 06:16:33 +00:00
< meta name = viewport content = "width=device-width, initial-scale=1" >
2014-08-25 07:35:41 +00:00
< title > FTE QuakeWorld< / title >
< style >
2017-07-31 17:15:37 +00:00
html,body { background-color:#000000; color:#808080; height:100%;width:100%;margin:0;padding:0;}
2015-08-07 17:49:49 +00:00
.emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
div.emscripten { text-align: center; padding:0; margin: 0;}
2017-07-31 17:15:37 +00:00
div.emscripten_border { padding:0; margin: 0; width:100%; height: 100%;}
2015-08-07 17:49:49 +00:00
/* the canvas *must not* have any border or padding, or mouse coords will be wrong */
canvas.emscripten { border: 0px none; width:100%; height:100%; padding:0; margin: 0;}
2014-08-25 07:35:41 +00:00
< / style >
< / head >
< body >
< div class = "emscripten" id = "status" > Is javascript enabled?< / div >
< div class = "emscripten" >
< progress value = "0" max = "100" id = "progress" hidden = 1 > < / progress >
< / div >
< div class = "emscripten_border" >
< canvas class = "emscripten" id = "canvas" oncontextmenu = "event.preventDefault()" > < / canvas >
< / div >
< script type = 'text/javascript' >
2015-08-07 17:49:49 +00:00
// connect to canvas
var Module = {
// preRun: [],
postRun: [function()
{
if (Module["sched"] === undefined) //if this happens then our main function failed to set up the main loop. ie: main didn't get called.
alert("Unable to initialise. You may need to restart your browser. If you get this often and inconsistently, consider using a 64bit browser instead.");
}],
print: function(msg)
{
console.log(msg);
},
printErr: function(text)
{
//this is infuriating as hell.
//emscripten is a piece of shit for actual released work.
if (text.substr(0, 28) == "Cannot enlarge memory arrays")
alert("Memory full/fragmented. Please reload the page.");
else
console.log(text);
},
2014-08-25 07:35:41 +00:00
canvas: document.getElementById('canvas'),
2015-08-07 17:49:49 +00:00
setStatus: function(text)
{
if (Module.setStatus.interval)
clearInterval(Module.setStatus.interval);
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
var statusElement = document.getElementById('status');
var progressElement = document.getElementById('progress');
if (m) {
text = m[1];
progressElement.value = parseInt(m[2])*100;
progressElement.max = parseInt(m[4])*100;
progressElement.hidden = false;
} else {
progressElement.value = null;
progressElement.max = null;
progressElement.hidden = true;
}
statusElement.innerHTML = text;
2014-08-25 07:35:41 +00:00
},
totalDependencies: 0,
2015-08-07 17:49:49 +00:00
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...');
2014-08-25 07:35:41 +00:00
2015-08-07 17:49:49 +00:00
// make a script
var s = document.createElement('script');
// set it up
s.setAttribute('src',"ftewebgl.js");
s.setAttribute('type',"text/javascript");
s.setAttribute('charset',"utf-8");
s.addEventListener('error', function() {alert("Oh noes! we got an error!");}, false);
// add to DOM
document.head.appendChild(s);
2014-08-25 07:35:41 +00:00
2015-08-07 17:49:49 +00:00
< / script >
2014-08-25 07:35:41 +00:00
< / body >
2015-08-07 17:49:49 +00:00
< / html >