110 lines
3.3 KiB
HTML
110 lines
3.3 KiB
HTML
|
<head>
|
||
|
<link rel="stylesheet" href="/css/98.css">
|
||
|
<link rel="stylesheet" href="/css/style.css">
|
||
|
</head>
|
||
|
|
||
|
<div class="bg-gray-800">
|
||
|
<div class="container m-auto">
|
||
|
<div class="window h-full">
|
||
|
<div class="title-bar">
|
||
|
<div class="title-bar-text">Doom 95</div>
|
||
|
<div class="title-bar-controls">
|
||
|
<button aria-label="Minimize" />
|
||
|
<button aria-label="Maximize" />
|
||
|
<button aria-label="Close" />
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="window-body w-full h-full m-0">
|
||
|
<div id="container" class="noselect m-0">
|
||
|
<canvas class="frame w-full h-full" id="canvas" oncontextmenu="event.preventDefault()" tabindex="-1" />
|
||
|
</div>
|
||
|
<script>
|
||
|
var commonArgs = [
|
||
|
"-iwad",
|
||
|
"doom1.wad",
|
||
|
"-window",
|
||
|
"-nogui",
|
||
|
"-nomusic",
|
||
|
"-config",
|
||
|
"default.cfg",
|
||
|
"-servername",
|
||
|
"doomflare",
|
||
|
];
|
||
|
|
||
|
var Module = {
|
||
|
onRuntimeInitialized: () => {
|
||
|
console.log("TEST");
|
||
|
callMain(commonArgs);
|
||
|
},
|
||
|
noInitialRun: true,
|
||
|
preRun: () => {
|
||
|
Module.FS.createPreloadedFile(
|
||
|
"",
|
||
|
"doom1.wad",
|
||
|
"doom1.wad",
|
||
|
true,
|
||
|
true
|
||
|
);
|
||
|
Module.FS.createPreloadedFile(
|
||
|
"",
|
||
|
"default.cfg",
|
||
|
"default.cfg",
|
||
|
true,
|
||
|
true
|
||
|
);
|
||
|
},
|
||
|
printErr: function (text) {
|
||
|
if (arguments.length > 1)
|
||
|
text = Array.prototype.slice.call(arguments).join(" ");
|
||
|
console.error(text);
|
||
|
},
|
||
|
canvas: (function () {
|
||
|
var canvas = document.getElementById("canvas");
|
||
|
canvas.addEventListener(
|
||
|
"webglcontextlost",
|
||
|
function (e) {
|
||
|
alert("WebGL context lost. You will need to reload the page.");
|
||
|
e.preventDefault();
|
||
|
},
|
||
|
false
|
||
|
);
|
||
|
return canvas;
|
||
|
})(),
|
||
|
print: function (text) {
|
||
|
console.log(text);
|
||
|
},
|
||
|
setStatus: function (text) {
|
||
|
console.log(text);
|
||
|
},
|
||
|
totalDependencies: 0,
|
||
|
monitorRunDependencies: function (left) {
|
||
|
this.totalDependencies = Math.max(this.totalDependencies, left);
|
||
|
Module.setStatus(
|
||
|
left
|
||
|
? "Preparing... (" +
|
||
|
(this.totalDependencies - left) +
|
||
|
"/" +
|
||
|
this.totalDependencies +
|
||
|
")"
|
||
|
: "All downloads complete."
|
||
|
);
|
||
|
},
|
||
|
};
|
||
|
|
||
|
window.onerror = function (event) {
|
||
|
Module.setStatus("Exception thrown, see JavaScript console");
|
||
|
Module.setStatus = function (text) {
|
||
|
if (text) Module.printErr("[post-exception status] " + text);
|
||
|
};
|
||
|
};
|
||
|
</script>
|
||
|
<script type="text/javascript" src="websockets-doom.js"></script>
|
||
|
</div>
|
||
|
|
||
|
<div class="status-bar">
|
||
|
<p class="status-bar-field">CPU Usage: 666%</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|