Uploaded game files
After Width: | Height: | Size: 2.5 KiB |
|
@ -0,0 +1,211 @@
|
||||||
|
/*************************************************************************/
|
||||||
|
/* audio.worklet.js */
|
||||||
|
/*************************************************************************/
|
||||||
|
/* This file is part of: */
|
||||||
|
/* GODOT ENGINE */
|
||||||
|
/* https://godotengine.org */
|
||||||
|
/*************************************************************************/
|
||||||
|
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
||||||
|
/* */
|
||||||
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
|
/* a copy of this software and associated documentation files (the */
|
||||||
|
/* "Software"), to deal in the Software without restriction, including */
|
||||||
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||||
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||||
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||||
|
/* the following conditions: */
|
||||||
|
/* */
|
||||||
|
/* The above copyright notice and this permission notice shall be */
|
||||||
|
/* included in all copies or substantial portions of the Software. */
|
||||||
|
/* */
|
||||||
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||||
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||||
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||||
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||||
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||||
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||||
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
class RingBuffer {
|
||||||
|
constructor(p_buffer, p_state, p_threads) {
|
||||||
|
this.buffer = p_buffer;
|
||||||
|
this.avail = p_state;
|
||||||
|
this.threads = p_threads;
|
||||||
|
this.rpos = 0;
|
||||||
|
this.wpos = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
data_left() {
|
||||||
|
return this.threads ? Atomics.load(this.avail, 0) : this.avail;
|
||||||
|
}
|
||||||
|
|
||||||
|
space_left() {
|
||||||
|
return this.buffer.length - this.data_left();
|
||||||
|
}
|
||||||
|
|
||||||
|
read(output) {
|
||||||
|
const size = this.buffer.length;
|
||||||
|
let from = 0;
|
||||||
|
let to_write = output.length;
|
||||||
|
if (this.rpos + to_write > size) {
|
||||||
|
const high = size - this.rpos;
|
||||||
|
output.set(this.buffer.subarray(this.rpos, size));
|
||||||
|
from = high;
|
||||||
|
to_write -= high;
|
||||||
|
this.rpos = 0;
|
||||||
|
}
|
||||||
|
if (to_write) {
|
||||||
|
output.set(this.buffer.subarray(this.rpos, this.rpos + to_write), from);
|
||||||
|
}
|
||||||
|
this.rpos += to_write;
|
||||||
|
if (this.threads) {
|
||||||
|
Atomics.add(this.avail, 0, -output.length);
|
||||||
|
Atomics.notify(this.avail, 0);
|
||||||
|
} else {
|
||||||
|
this.avail -= output.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
write(p_buffer) {
|
||||||
|
const to_write = p_buffer.length;
|
||||||
|
const mw = this.buffer.length - this.wpos;
|
||||||
|
if (mw >= to_write) {
|
||||||
|
this.buffer.set(p_buffer, this.wpos);
|
||||||
|
this.wpos += to_write;
|
||||||
|
if (mw === to_write) {
|
||||||
|
this.wpos = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const high = p_buffer.subarray(0, mw);
|
||||||
|
const low = p_buffer.subarray(mw);
|
||||||
|
this.buffer.set(high, this.wpos);
|
||||||
|
this.buffer.set(low);
|
||||||
|
this.wpos = low.length;
|
||||||
|
}
|
||||||
|
if (this.threads) {
|
||||||
|
Atomics.add(this.avail, 0, to_write);
|
||||||
|
Atomics.notify(this.avail, 0);
|
||||||
|
} else {
|
||||||
|
this.avail += to_write;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class GodotProcessor extends AudioWorkletProcessor {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.threads = false;
|
||||||
|
this.running = true;
|
||||||
|
this.lock = null;
|
||||||
|
this.notifier = null;
|
||||||
|
this.output = null;
|
||||||
|
this.output_buffer = new Float32Array();
|
||||||
|
this.input = null;
|
||||||
|
this.input_buffer = new Float32Array();
|
||||||
|
this.port.onmessage = (event) => {
|
||||||
|
const cmd = event.data['cmd'];
|
||||||
|
const data = event.data['data'];
|
||||||
|
this.parse_message(cmd, data);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
process_notify() {
|
||||||
|
if (this.notifier) {
|
||||||
|
Atomics.add(this.notifier, 0, 1);
|
||||||
|
Atomics.notify(this.notifier, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parse_message(p_cmd, p_data) {
|
||||||
|
if (p_cmd === 'start' && p_data) {
|
||||||
|
const state = p_data[0];
|
||||||
|
let idx = 0;
|
||||||
|
this.threads = true;
|
||||||
|
this.lock = state.subarray(idx, ++idx);
|
||||||
|
this.notifier = state.subarray(idx, ++idx);
|
||||||
|
const avail_in = state.subarray(idx, ++idx);
|
||||||
|
const avail_out = state.subarray(idx, ++idx);
|
||||||
|
this.input = new RingBuffer(p_data[1], avail_in, true);
|
||||||
|
this.output = new RingBuffer(p_data[2], avail_out, true);
|
||||||
|
} else if (p_cmd === 'stop') {
|
||||||
|
this.running = false;
|
||||||
|
this.output = null;
|
||||||
|
this.input = null;
|
||||||
|
} else if (p_cmd === 'start_nothreads') {
|
||||||
|
this.output = new RingBuffer(p_data[0], p_data[0].length, false);
|
||||||
|
} else if (p_cmd === 'chunk') {
|
||||||
|
this.output.write(p_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static array_has_data(arr) {
|
||||||
|
return arr.length && arr[0].length && arr[0][0].length;
|
||||||
|
}
|
||||||
|
|
||||||
|
process(inputs, outputs, parameters) {
|
||||||
|
if (!this.running) {
|
||||||
|
return false; // Stop processing.
|
||||||
|
}
|
||||||
|
if (this.output === null) {
|
||||||
|
return true; // Not ready yet, keep processing.
|
||||||
|
}
|
||||||
|
const process_input = GodotProcessor.array_has_data(inputs);
|
||||||
|
if (process_input) {
|
||||||
|
const input = inputs[0];
|
||||||
|
const chunk = input[0].length * input.length;
|
||||||
|
if (this.input_buffer.length !== chunk) {
|
||||||
|
this.input_buffer = new Float32Array(chunk);
|
||||||
|
}
|
||||||
|
if (!this.threads) {
|
||||||
|
GodotProcessor.write_input(this.input_buffer, input);
|
||||||
|
this.port.postMessage({ 'cmd': 'input', 'data': this.input_buffer });
|
||||||
|
} else if (this.input.space_left() >= chunk) {
|
||||||
|
GodotProcessor.write_input(this.input_buffer, input);
|
||||||
|
this.input.write(this.input_buffer);
|
||||||
|
} else {
|
||||||
|
this.port.postMessage('Input buffer is full! Skipping input frame.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const process_output = GodotProcessor.array_has_data(outputs);
|
||||||
|
if (process_output) {
|
||||||
|
const output = outputs[0];
|
||||||
|
const chunk = output[0].length * output.length;
|
||||||
|
if (this.output_buffer.length !== chunk) {
|
||||||
|
this.output_buffer = new Float32Array(chunk);
|
||||||
|
}
|
||||||
|
if (this.output.data_left() >= chunk) {
|
||||||
|
this.output.read(this.output_buffer);
|
||||||
|
GodotProcessor.write_output(output, this.output_buffer);
|
||||||
|
if (!this.threads) {
|
||||||
|
this.port.postMessage({ 'cmd': 'read', 'data': chunk });
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.port.postMessage('Output buffer has not enough frames! Skipping output frame.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.process_notify();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static write_output(dest, source) {
|
||||||
|
const channels = dest.length;
|
||||||
|
for (let ch = 0; ch < channels; ch++) {
|
||||||
|
for (let sample = 0; sample < dest[ch].length; sample++) {
|
||||||
|
dest[ch][sample] = source[sample * channels + ch];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static write_input(dest, source) {
|
||||||
|
const channels = source.length;
|
||||||
|
for (let ch = 0; ch < channels; ch++) {
|
||||||
|
for (let sample = 0; sample < source[ch].length; sample++) {
|
||||||
|
dest[sample * channels + ch] = source[ch][sample];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
registerProcessor('godot-processor', GodotProcessor);
|
|
@ -0,0 +1,248 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
|
||||||
|
<head>
|
||||||
|
<meta charset='utf-8' />
|
||||||
|
<meta name='viewport' content='width=device-width, user-scalable=no' />
|
||||||
|
<title>The Lost Memory</title>
|
||||||
|
<style type='text/css'>
|
||||||
|
|
||||||
|
body {
|
||||||
|
touch-action: none;
|
||||||
|
margin: 0;
|
||||||
|
border: 0 none;
|
||||||
|
padding: 0;
|
||||||
|
text-align: center;
|
||||||
|
background-color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
#canvas {
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#canvas:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.godot {
|
||||||
|
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
|
||||||
|
color: #e0e0e0;
|
||||||
|
background-color: #3b3943;
|
||||||
|
background-image: linear-gradient(to bottom, #403e48, #35333c);
|
||||||
|
border: 1px solid #45434e;
|
||||||
|
box-shadow: 0 0 1px 1px #2f2d35;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Status display
|
||||||
|
* ============== */
|
||||||
|
|
||||||
|
#status {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
/* don't consume click events - make children visible explicitly */
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-progress {
|
||||||
|
width: 366px;
|
||||||
|
height: 7px;
|
||||||
|
background-color: #38363A;
|
||||||
|
border: 1px solid #444246;
|
||||||
|
padding: 1px;
|
||||||
|
box-shadow: 0 0 2px 1px #1B1C22;
|
||||||
|
border-radius: 2px;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (orientation:portrait) {
|
||||||
|
#status-progress {
|
||||||
|
width: 61.8%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-progress-inner {
|
||||||
|
height: 100%;
|
||||||
|
width: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
transition: width 0.5s linear;
|
||||||
|
background-color: #202020;
|
||||||
|
border: 1px solid #222223;
|
||||||
|
box-shadow: 0 0 1px 1px #27282E;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-indeterminate {
|
||||||
|
height: 42px;
|
||||||
|
visibility: visible;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-indeterminate > div {
|
||||||
|
width: 4.5px;
|
||||||
|
height: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 9px 3px 0 3px;
|
||||||
|
border-color: #2b2b2b transparent transparent transparent;
|
||||||
|
transform-origin: center 21px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
|
||||||
|
|
||||||
|
#status-notice {
|
||||||
|
margin: 0 100px;
|
||||||
|
line-height: 1.3;
|
||||||
|
visibility: visible;
|
||||||
|
padding: 4px 6px;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link id='-gd-engine-icon' rel='icon' type='image/png' href='index.icon.png' />
|
||||||
|
<link rel='apple-touch-icon' href='index.apple-touch-icon.png'/>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<canvas id='canvas'>
|
||||||
|
HTML5 canvas appears to be unsupported in the current browser.<br />
|
||||||
|
Please try updating or use a different browser.
|
||||||
|
</canvas>
|
||||||
|
<div id='status'>
|
||||||
|
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
|
||||||
|
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
|
<div id='status-notice' class='godot' style='display: none;'></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type='text/javascript' src='index.js'></script>
|
||||||
|
<script type='text/javascript'>//<![CDATA[
|
||||||
|
|
||||||
|
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":12891840,"index.wasm":13789463},"focusCanvas":true,"gdnativeLibs":[]};
|
||||||
|
var engine = new Engine(GODOT_CONFIG);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
const INDETERMINATE_STATUS_STEP_MS = 100;
|
||||||
|
var statusProgress = document.getElementById('status-progress');
|
||||||
|
var statusProgressInner = document.getElementById('status-progress-inner');
|
||||||
|
var statusIndeterminate = document.getElementById('status-indeterminate');
|
||||||
|
var statusNotice = document.getElementById('status-notice');
|
||||||
|
|
||||||
|
var initializing = true;
|
||||||
|
var statusMode = 'hidden';
|
||||||
|
|
||||||
|
var animationCallbacks = [];
|
||||||
|
function animate(time) {
|
||||||
|
animationCallbacks.forEach(callback => callback(time));
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
}
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
|
||||||
|
function setStatusMode(mode) {
|
||||||
|
|
||||||
|
if (statusMode === mode || !initializing)
|
||||||
|
return;
|
||||||
|
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
|
||||||
|
elem.style.display = 'none';
|
||||||
|
});
|
||||||
|
animationCallbacks = animationCallbacks.filter(function(value) {
|
||||||
|
return (value != animateStatusIndeterminate);
|
||||||
|
});
|
||||||
|
switch (mode) {
|
||||||
|
case 'progress':
|
||||||
|
statusProgress.style.display = 'block';
|
||||||
|
break;
|
||||||
|
case 'indeterminate':
|
||||||
|
statusIndeterminate.style.display = 'block';
|
||||||
|
animationCallbacks.push(animateStatusIndeterminate);
|
||||||
|
break;
|
||||||
|
case 'notice':
|
||||||
|
statusNotice.style.display = 'block';
|
||||||
|
break;
|
||||||
|
case 'hidden':
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error('Invalid status mode');
|
||||||
|
}
|
||||||
|
statusMode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
function animateStatusIndeterminate(ms) {
|
||||||
|
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
|
||||||
|
if (statusIndeterminate.children[i].style.borderTopColor == '') {
|
||||||
|
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
|
||||||
|
child.style.borderTopColor = '';
|
||||||
|
});
|
||||||
|
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setStatusNotice(text) {
|
||||||
|
while (statusNotice.lastChild) {
|
||||||
|
statusNotice.removeChild(statusNotice.lastChild);
|
||||||
|
}
|
||||||
|
var lines = text.split('\n');
|
||||||
|
lines.forEach((line) => {
|
||||||
|
statusNotice.appendChild(document.createTextNode(line));
|
||||||
|
statusNotice.appendChild(document.createElement('br'));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function displayFailureNotice(err) {
|
||||||
|
var msg = err.message || err;
|
||||||
|
console.error(msg);
|
||||||
|
setStatusNotice(msg);
|
||||||
|
setStatusMode('notice');
|
||||||
|
initializing = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!Engine.isWebGLAvailable()) {
|
||||||
|
displayFailureNotice('WebGL not available');
|
||||||
|
} else {
|
||||||
|
setStatusMode('indeterminate');
|
||||||
|
engine.startGame({
|
||||||
|
'onProgress': function (current, total) {
|
||||||
|
if (total > 0) {
|
||||||
|
statusProgressInner.style.width = current/total * 100 + '%';
|
||||||
|
setStatusMode('progress');
|
||||||
|
if (current === total) {
|
||||||
|
// wait for progress bar animation
|
||||||
|
setTimeout(() => {
|
||||||
|
setStatusMode('indeterminate');
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setStatusMode('indeterminate');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}).then(() => {
|
||||||
|
setStatusMode('hidden');
|
||||||
|
initializing = false;
|
||||||
|
}, displayFailureNotice);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
//]]></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.5 KiB |
|
@ -0,0 +1,211 @@
|
||||||
|
/*************************************************************************/
|
||||||
|
/* audio.worklet.js */
|
||||||
|
/*************************************************************************/
|
||||||
|
/* This file is part of: */
|
||||||
|
/* GODOT ENGINE */
|
||||||
|
/* https://godotengine.org */
|
||||||
|
/*************************************************************************/
|
||||||
|
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
||||||
|
/* */
|
||||||
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
|
/* a copy of this software and associated documentation files (the */
|
||||||
|
/* "Software"), to deal in the Software without restriction, including */
|
||||||
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||||
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||||
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||||
|
/* the following conditions: */
|
||||||
|
/* */
|
||||||
|
/* The above copyright notice and this permission notice shall be */
|
||||||
|
/* included in all copies or substantial portions of the Software. */
|
||||||
|
/* */
|
||||||
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||||
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||||
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||||
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||||
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||||
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||||
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
class RingBuffer {
|
||||||
|
constructor(p_buffer, p_state, p_threads) {
|
||||||
|
this.buffer = p_buffer;
|
||||||
|
this.avail = p_state;
|
||||||
|
this.threads = p_threads;
|
||||||
|
this.rpos = 0;
|
||||||
|
this.wpos = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
data_left() {
|
||||||
|
return this.threads ? Atomics.load(this.avail, 0) : this.avail;
|
||||||
|
}
|
||||||
|
|
||||||
|
space_left() {
|
||||||
|
return this.buffer.length - this.data_left();
|
||||||
|
}
|
||||||
|
|
||||||
|
read(output) {
|
||||||
|
const size = this.buffer.length;
|
||||||
|
let from = 0;
|
||||||
|
let to_write = output.length;
|
||||||
|
if (this.rpos + to_write > size) {
|
||||||
|
const high = size - this.rpos;
|
||||||
|
output.set(this.buffer.subarray(this.rpos, size));
|
||||||
|
from = high;
|
||||||
|
to_write -= high;
|
||||||
|
this.rpos = 0;
|
||||||
|
}
|
||||||
|
if (to_write) {
|
||||||
|
output.set(this.buffer.subarray(this.rpos, this.rpos + to_write), from);
|
||||||
|
}
|
||||||
|
this.rpos += to_write;
|
||||||
|
if (this.threads) {
|
||||||
|
Atomics.add(this.avail, 0, -output.length);
|
||||||
|
Atomics.notify(this.avail, 0);
|
||||||
|
} else {
|
||||||
|
this.avail -= output.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
write(p_buffer) {
|
||||||
|
const to_write = p_buffer.length;
|
||||||
|
const mw = this.buffer.length - this.wpos;
|
||||||
|
if (mw >= to_write) {
|
||||||
|
this.buffer.set(p_buffer, this.wpos);
|
||||||
|
this.wpos += to_write;
|
||||||
|
if (mw === to_write) {
|
||||||
|
this.wpos = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const high = p_buffer.subarray(0, mw);
|
||||||
|
const low = p_buffer.subarray(mw);
|
||||||
|
this.buffer.set(high, this.wpos);
|
||||||
|
this.buffer.set(low);
|
||||||
|
this.wpos = low.length;
|
||||||
|
}
|
||||||
|
if (this.threads) {
|
||||||
|
Atomics.add(this.avail, 0, to_write);
|
||||||
|
Atomics.notify(this.avail, 0);
|
||||||
|
} else {
|
||||||
|
this.avail += to_write;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class GodotProcessor extends AudioWorkletProcessor {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.threads = false;
|
||||||
|
this.running = true;
|
||||||
|
this.lock = null;
|
||||||
|
this.notifier = null;
|
||||||
|
this.output = null;
|
||||||
|
this.output_buffer = new Float32Array();
|
||||||
|
this.input = null;
|
||||||
|
this.input_buffer = new Float32Array();
|
||||||
|
this.port.onmessage = (event) => {
|
||||||
|
const cmd = event.data['cmd'];
|
||||||
|
const data = event.data['data'];
|
||||||
|
this.parse_message(cmd, data);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
process_notify() {
|
||||||
|
if (this.notifier) {
|
||||||
|
Atomics.add(this.notifier, 0, 1);
|
||||||
|
Atomics.notify(this.notifier, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parse_message(p_cmd, p_data) {
|
||||||
|
if (p_cmd === 'start' && p_data) {
|
||||||
|
const state = p_data[0];
|
||||||
|
let idx = 0;
|
||||||
|
this.threads = true;
|
||||||
|
this.lock = state.subarray(idx, ++idx);
|
||||||
|
this.notifier = state.subarray(idx, ++idx);
|
||||||
|
const avail_in = state.subarray(idx, ++idx);
|
||||||
|
const avail_out = state.subarray(idx, ++idx);
|
||||||
|
this.input = new RingBuffer(p_data[1], avail_in, true);
|
||||||
|
this.output = new RingBuffer(p_data[2], avail_out, true);
|
||||||
|
} else if (p_cmd === 'stop') {
|
||||||
|
this.running = false;
|
||||||
|
this.output = null;
|
||||||
|
this.input = null;
|
||||||
|
} else if (p_cmd === 'start_nothreads') {
|
||||||
|
this.output = new RingBuffer(p_data[0], p_data[0].length, false);
|
||||||
|
} else if (p_cmd === 'chunk') {
|
||||||
|
this.output.write(p_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static array_has_data(arr) {
|
||||||
|
return arr.length && arr[0].length && arr[0][0].length;
|
||||||
|
}
|
||||||
|
|
||||||
|
process(inputs, outputs, parameters) {
|
||||||
|
if (!this.running) {
|
||||||
|
return false; // Stop processing.
|
||||||
|
}
|
||||||
|
if (this.output === null) {
|
||||||
|
return true; // Not ready yet, keep processing.
|
||||||
|
}
|
||||||
|
const process_input = GodotProcessor.array_has_data(inputs);
|
||||||
|
if (process_input) {
|
||||||
|
const input = inputs[0];
|
||||||
|
const chunk = input[0].length * input.length;
|
||||||
|
if (this.input_buffer.length !== chunk) {
|
||||||
|
this.input_buffer = new Float32Array(chunk);
|
||||||
|
}
|
||||||
|
if (!this.threads) {
|
||||||
|
GodotProcessor.write_input(this.input_buffer, input);
|
||||||
|
this.port.postMessage({ 'cmd': 'input', 'data': this.input_buffer });
|
||||||
|
} else if (this.input.space_left() >= chunk) {
|
||||||
|
GodotProcessor.write_input(this.input_buffer, input);
|
||||||
|
this.input.write(this.input_buffer);
|
||||||
|
} else {
|
||||||
|
this.port.postMessage('Input buffer is full! Skipping input frame.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const process_output = GodotProcessor.array_has_data(outputs);
|
||||||
|
if (process_output) {
|
||||||
|
const output = outputs[0];
|
||||||
|
const chunk = output[0].length * output.length;
|
||||||
|
if (this.output_buffer.length !== chunk) {
|
||||||
|
this.output_buffer = new Float32Array(chunk);
|
||||||
|
}
|
||||||
|
if (this.output.data_left() >= chunk) {
|
||||||
|
this.output.read(this.output_buffer);
|
||||||
|
GodotProcessor.write_output(output, this.output_buffer);
|
||||||
|
if (!this.threads) {
|
||||||
|
this.port.postMessage({ 'cmd': 'read', 'data': chunk });
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.port.postMessage('Output buffer has not enough frames! Skipping output frame.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.process_notify();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static write_output(dest, source) {
|
||||||
|
const channels = dest.length;
|
||||||
|
for (let ch = 0; ch < channels; ch++) {
|
||||||
|
for (let sample = 0; sample < dest[ch].length; sample++) {
|
||||||
|
dest[ch][sample] = source[sample * channels + ch];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static write_input(dest, source) {
|
||||||
|
const channels = source.length;
|
||||||
|
for (let ch = 0; ch < channels; ch++) {
|
||||||
|
for (let sample = 0; sample < source[ch].length; sample++) {
|
||||||
|
dest[sample * channels + ch] = source[ch][sample];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
registerProcessor('godot-processor', GodotProcessor);
|
|
@ -0,0 +1,248 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
|
||||||
|
<head>
|
||||||
|
<meta charset='utf-8' />
|
||||||
|
<meta name='viewport' content='width=device-width, user-scalable=no' />
|
||||||
|
<title>The Lost Memory</title>
|
||||||
|
<style type='text/css'>
|
||||||
|
|
||||||
|
body {
|
||||||
|
touch-action: none;
|
||||||
|
margin: 0;
|
||||||
|
border: 0 none;
|
||||||
|
padding: 0;
|
||||||
|
text-align: center;
|
||||||
|
background-color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
#canvas {
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#canvas:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.godot {
|
||||||
|
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
|
||||||
|
color: #e0e0e0;
|
||||||
|
background-color: #3b3943;
|
||||||
|
background-image: linear-gradient(to bottom, #403e48, #35333c);
|
||||||
|
border: 1px solid #45434e;
|
||||||
|
box-shadow: 0 0 1px 1px #2f2d35;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Status display
|
||||||
|
* ============== */
|
||||||
|
|
||||||
|
#status {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
/* don't consume click events - make children visible explicitly */
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-progress {
|
||||||
|
width: 366px;
|
||||||
|
height: 7px;
|
||||||
|
background-color: #38363A;
|
||||||
|
border: 1px solid #444246;
|
||||||
|
padding: 1px;
|
||||||
|
box-shadow: 0 0 2px 1px #1B1C22;
|
||||||
|
border-radius: 2px;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (orientation:portrait) {
|
||||||
|
#status-progress {
|
||||||
|
width: 61.8%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-progress-inner {
|
||||||
|
height: 100%;
|
||||||
|
width: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
transition: width 0.5s linear;
|
||||||
|
background-color: #202020;
|
||||||
|
border: 1px solid #222223;
|
||||||
|
box-shadow: 0 0 1px 1px #27282E;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-indeterminate {
|
||||||
|
height: 42px;
|
||||||
|
visibility: visible;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-indeterminate > div {
|
||||||
|
width: 4.5px;
|
||||||
|
height: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 9px 3px 0 3px;
|
||||||
|
border-color: #2b2b2b transparent transparent transparent;
|
||||||
|
transform-origin: center 21px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
|
||||||
|
|
||||||
|
#status-notice {
|
||||||
|
margin: 0 100px;
|
||||||
|
line-height: 1.3;
|
||||||
|
visibility: visible;
|
||||||
|
padding: 4px 6px;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link id='-gd-engine-icon' rel='icon' type='image/png' href='index.icon.png' />
|
||||||
|
<link rel='apple-touch-icon' href='index.apple-touch-icon.png'/>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<canvas id='canvas'>
|
||||||
|
HTML5 canvas appears to be unsupported in the current browser.<br />
|
||||||
|
Please try updating or use a different browser.
|
||||||
|
</canvas>
|
||||||
|
<div id='status'>
|
||||||
|
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
|
||||||
|
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
|
<div id='status-notice' class='godot' style='display: none;'></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type='text/javascript' src='index.js'></script>
|
||||||
|
<script type='text/javascript'>//<![CDATA[
|
||||||
|
|
||||||
|
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":12944048,"index.wasm":13789463},"focusCanvas":true,"gdnativeLibs":[]};
|
||||||
|
var engine = new Engine(GODOT_CONFIG);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
const INDETERMINATE_STATUS_STEP_MS = 100;
|
||||||
|
var statusProgress = document.getElementById('status-progress');
|
||||||
|
var statusProgressInner = document.getElementById('status-progress-inner');
|
||||||
|
var statusIndeterminate = document.getElementById('status-indeterminate');
|
||||||
|
var statusNotice = document.getElementById('status-notice');
|
||||||
|
|
||||||
|
var initializing = true;
|
||||||
|
var statusMode = 'hidden';
|
||||||
|
|
||||||
|
var animationCallbacks = [];
|
||||||
|
function animate(time) {
|
||||||
|
animationCallbacks.forEach(callback => callback(time));
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
}
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
|
||||||
|
function setStatusMode(mode) {
|
||||||
|
|
||||||
|
if (statusMode === mode || !initializing)
|
||||||
|
return;
|
||||||
|
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
|
||||||
|
elem.style.display = 'none';
|
||||||
|
});
|
||||||
|
animationCallbacks = animationCallbacks.filter(function(value) {
|
||||||
|
return (value != animateStatusIndeterminate);
|
||||||
|
});
|
||||||
|
switch (mode) {
|
||||||
|
case 'progress':
|
||||||
|
statusProgress.style.display = 'block';
|
||||||
|
break;
|
||||||
|
case 'indeterminate':
|
||||||
|
statusIndeterminate.style.display = 'block';
|
||||||
|
animationCallbacks.push(animateStatusIndeterminate);
|
||||||
|
break;
|
||||||
|
case 'notice':
|
||||||
|
statusNotice.style.display = 'block';
|
||||||
|
break;
|
||||||
|
case 'hidden':
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error('Invalid status mode');
|
||||||
|
}
|
||||||
|
statusMode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
function animateStatusIndeterminate(ms) {
|
||||||
|
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
|
||||||
|
if (statusIndeterminate.children[i].style.borderTopColor == '') {
|
||||||
|
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
|
||||||
|
child.style.borderTopColor = '';
|
||||||
|
});
|
||||||
|
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setStatusNotice(text) {
|
||||||
|
while (statusNotice.lastChild) {
|
||||||
|
statusNotice.removeChild(statusNotice.lastChild);
|
||||||
|
}
|
||||||
|
var lines = text.split('\n');
|
||||||
|
lines.forEach((line) => {
|
||||||
|
statusNotice.appendChild(document.createTextNode(line));
|
||||||
|
statusNotice.appendChild(document.createElement('br'));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function displayFailureNotice(err) {
|
||||||
|
var msg = err.message || err;
|
||||||
|
console.error(msg);
|
||||||
|
setStatusNotice(msg);
|
||||||
|
setStatusMode('notice');
|
||||||
|
initializing = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!Engine.isWebGLAvailable()) {
|
||||||
|
displayFailureNotice('WebGL not available');
|
||||||
|
} else {
|
||||||
|
setStatusMode('indeterminate');
|
||||||
|
engine.startGame({
|
||||||
|
'onProgress': function (current, total) {
|
||||||
|
if (total > 0) {
|
||||||
|
statusProgressInner.style.width = current/total * 100 + '%';
|
||||||
|
setStatusMode('progress');
|
||||||
|
if (current === total) {
|
||||||
|
// wait for progress bar animation
|
||||||
|
setTimeout(() => {
|
||||||
|
setStatusMode('indeterminate');
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setStatusMode('indeterminate');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}).then(() => {
|
||||||
|
setStatusMode('hidden');
|
||||||
|
initializing = false;
|
||||||
|
}, displayFailureNotice);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
//]]></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.5 KiB |
|
@ -0,0 +1,211 @@
|
||||||
|
/*************************************************************************/
|
||||||
|
/* audio.worklet.js */
|
||||||
|
/*************************************************************************/
|
||||||
|
/* This file is part of: */
|
||||||
|
/* GODOT ENGINE */
|
||||||
|
/* https://godotengine.org */
|
||||||
|
/*************************************************************************/
|
||||||
|
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
||||||
|
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
||||||
|
/* */
|
||||||
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
||||||
|
/* a copy of this software and associated documentation files (the */
|
||||||
|
/* "Software"), to deal in the Software without restriction, including */
|
||||||
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
||||||
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
||||||
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
||||||
|
/* the following conditions: */
|
||||||
|
/* */
|
||||||
|
/* The above copyright notice and this permission notice shall be */
|
||||||
|
/* included in all copies or substantial portions of the Software. */
|
||||||
|
/* */
|
||||||
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
||||||
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
||||||
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
||||||
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
||||||
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
||||||
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
||||||
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
class RingBuffer {
|
||||||
|
constructor(p_buffer, p_state, p_threads) {
|
||||||
|
this.buffer = p_buffer;
|
||||||
|
this.avail = p_state;
|
||||||
|
this.threads = p_threads;
|
||||||
|
this.rpos = 0;
|
||||||
|
this.wpos = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
data_left() {
|
||||||
|
return this.threads ? Atomics.load(this.avail, 0) : this.avail;
|
||||||
|
}
|
||||||
|
|
||||||
|
space_left() {
|
||||||
|
return this.buffer.length - this.data_left();
|
||||||
|
}
|
||||||
|
|
||||||
|
read(output) {
|
||||||
|
const size = this.buffer.length;
|
||||||
|
let from = 0;
|
||||||
|
let to_write = output.length;
|
||||||
|
if (this.rpos + to_write > size) {
|
||||||
|
const high = size - this.rpos;
|
||||||
|
output.set(this.buffer.subarray(this.rpos, size));
|
||||||
|
from = high;
|
||||||
|
to_write -= high;
|
||||||
|
this.rpos = 0;
|
||||||
|
}
|
||||||
|
if (to_write) {
|
||||||
|
output.set(this.buffer.subarray(this.rpos, this.rpos + to_write), from);
|
||||||
|
}
|
||||||
|
this.rpos += to_write;
|
||||||
|
if (this.threads) {
|
||||||
|
Atomics.add(this.avail, 0, -output.length);
|
||||||
|
Atomics.notify(this.avail, 0);
|
||||||
|
} else {
|
||||||
|
this.avail -= output.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
write(p_buffer) {
|
||||||
|
const to_write = p_buffer.length;
|
||||||
|
const mw = this.buffer.length - this.wpos;
|
||||||
|
if (mw >= to_write) {
|
||||||
|
this.buffer.set(p_buffer, this.wpos);
|
||||||
|
this.wpos += to_write;
|
||||||
|
if (mw === to_write) {
|
||||||
|
this.wpos = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const high = p_buffer.subarray(0, mw);
|
||||||
|
const low = p_buffer.subarray(mw);
|
||||||
|
this.buffer.set(high, this.wpos);
|
||||||
|
this.buffer.set(low);
|
||||||
|
this.wpos = low.length;
|
||||||
|
}
|
||||||
|
if (this.threads) {
|
||||||
|
Atomics.add(this.avail, 0, to_write);
|
||||||
|
Atomics.notify(this.avail, 0);
|
||||||
|
} else {
|
||||||
|
this.avail += to_write;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class GodotProcessor extends AudioWorkletProcessor {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.threads = false;
|
||||||
|
this.running = true;
|
||||||
|
this.lock = null;
|
||||||
|
this.notifier = null;
|
||||||
|
this.output = null;
|
||||||
|
this.output_buffer = new Float32Array();
|
||||||
|
this.input = null;
|
||||||
|
this.input_buffer = new Float32Array();
|
||||||
|
this.port.onmessage = (event) => {
|
||||||
|
const cmd = event.data['cmd'];
|
||||||
|
const data = event.data['data'];
|
||||||
|
this.parse_message(cmd, data);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
process_notify() {
|
||||||
|
if (this.notifier) {
|
||||||
|
Atomics.add(this.notifier, 0, 1);
|
||||||
|
Atomics.notify(this.notifier, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parse_message(p_cmd, p_data) {
|
||||||
|
if (p_cmd === 'start' && p_data) {
|
||||||
|
const state = p_data[0];
|
||||||
|
let idx = 0;
|
||||||
|
this.threads = true;
|
||||||
|
this.lock = state.subarray(idx, ++idx);
|
||||||
|
this.notifier = state.subarray(idx, ++idx);
|
||||||
|
const avail_in = state.subarray(idx, ++idx);
|
||||||
|
const avail_out = state.subarray(idx, ++idx);
|
||||||
|
this.input = new RingBuffer(p_data[1], avail_in, true);
|
||||||
|
this.output = new RingBuffer(p_data[2], avail_out, true);
|
||||||
|
} else if (p_cmd === 'stop') {
|
||||||
|
this.running = false;
|
||||||
|
this.output = null;
|
||||||
|
this.input = null;
|
||||||
|
} else if (p_cmd === 'start_nothreads') {
|
||||||
|
this.output = new RingBuffer(p_data[0], p_data[0].length, false);
|
||||||
|
} else if (p_cmd === 'chunk') {
|
||||||
|
this.output.write(p_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static array_has_data(arr) {
|
||||||
|
return arr.length && arr[0].length && arr[0][0].length;
|
||||||
|
}
|
||||||
|
|
||||||
|
process(inputs, outputs, parameters) {
|
||||||
|
if (!this.running) {
|
||||||
|
return false; // Stop processing.
|
||||||
|
}
|
||||||
|
if (this.output === null) {
|
||||||
|
return true; // Not ready yet, keep processing.
|
||||||
|
}
|
||||||
|
const process_input = GodotProcessor.array_has_data(inputs);
|
||||||
|
if (process_input) {
|
||||||
|
const input = inputs[0];
|
||||||
|
const chunk = input[0].length * input.length;
|
||||||
|
if (this.input_buffer.length !== chunk) {
|
||||||
|
this.input_buffer = new Float32Array(chunk);
|
||||||
|
}
|
||||||
|
if (!this.threads) {
|
||||||
|
GodotProcessor.write_input(this.input_buffer, input);
|
||||||
|
this.port.postMessage({ 'cmd': 'input', 'data': this.input_buffer });
|
||||||
|
} else if (this.input.space_left() >= chunk) {
|
||||||
|
GodotProcessor.write_input(this.input_buffer, input);
|
||||||
|
this.input.write(this.input_buffer);
|
||||||
|
} else {
|
||||||
|
this.port.postMessage('Input buffer is full! Skipping input frame.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const process_output = GodotProcessor.array_has_data(outputs);
|
||||||
|
if (process_output) {
|
||||||
|
const output = outputs[0];
|
||||||
|
const chunk = output[0].length * output.length;
|
||||||
|
if (this.output_buffer.length !== chunk) {
|
||||||
|
this.output_buffer = new Float32Array(chunk);
|
||||||
|
}
|
||||||
|
if (this.output.data_left() >= chunk) {
|
||||||
|
this.output.read(this.output_buffer);
|
||||||
|
GodotProcessor.write_output(output, this.output_buffer);
|
||||||
|
if (!this.threads) {
|
||||||
|
this.port.postMessage({ 'cmd': 'read', 'data': chunk });
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.port.postMessage('Output buffer has not enough frames! Skipping output frame.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.process_notify();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static write_output(dest, source) {
|
||||||
|
const channels = dest.length;
|
||||||
|
for (let ch = 0; ch < channels; ch++) {
|
||||||
|
for (let sample = 0; sample < dest[ch].length; sample++) {
|
||||||
|
dest[ch][sample] = source[sample * channels + ch];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static write_input(dest, source) {
|
||||||
|
const channels = source.length;
|
||||||
|
for (let ch = 0; ch < channels; ch++) {
|
||||||
|
for (let sample = 0; sample < source[ch].length; sample++) {
|
||||||
|
dest[sample * channels + ch] = source[ch][sample];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
registerProcessor('godot-processor', GodotProcessor);
|
|
@ -0,0 +1,248 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
|
||||||
|
<head>
|
||||||
|
<meta charset='utf-8' />
|
||||||
|
<meta name='viewport' content='width=device-width, user-scalable=no' />
|
||||||
|
<title>The Lost Memory</title>
|
||||||
|
<style type='text/css'>
|
||||||
|
|
||||||
|
body {
|
||||||
|
touch-action: none;
|
||||||
|
margin: 0;
|
||||||
|
border: 0 none;
|
||||||
|
padding: 0;
|
||||||
|
text-align: center;
|
||||||
|
background-color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
#canvas {
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#canvas:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.godot {
|
||||||
|
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
|
||||||
|
color: #e0e0e0;
|
||||||
|
background-color: #3b3943;
|
||||||
|
background-image: linear-gradient(to bottom, #403e48, #35333c);
|
||||||
|
border: 1px solid #45434e;
|
||||||
|
box-shadow: 0 0 1px 1px #2f2d35;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Status display
|
||||||
|
* ============== */
|
||||||
|
|
||||||
|
#status {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
/* don't consume click events - make children visible explicitly */
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-progress {
|
||||||
|
width: 366px;
|
||||||
|
height: 7px;
|
||||||
|
background-color: #38363A;
|
||||||
|
border: 1px solid #444246;
|
||||||
|
padding: 1px;
|
||||||
|
box-shadow: 0 0 2px 1px #1B1C22;
|
||||||
|
border-radius: 2px;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (orientation:portrait) {
|
||||||
|
#status-progress {
|
||||||
|
width: 61.8%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-progress-inner {
|
||||||
|
height: 100%;
|
||||||
|
width: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
transition: width 0.5s linear;
|
||||||
|
background-color: #202020;
|
||||||
|
border: 1px solid #222223;
|
||||||
|
box-shadow: 0 0 1px 1px #27282E;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-indeterminate {
|
||||||
|
height: 42px;
|
||||||
|
visibility: visible;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-indeterminate > div {
|
||||||
|
width: 4.5px;
|
||||||
|
height: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 9px 3px 0 3px;
|
||||||
|
border-color: #2b2b2b transparent transparent transparent;
|
||||||
|
transform-origin: center 21px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
|
||||||
|
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
|
||||||
|
|
||||||
|
#status-notice {
|
||||||
|
margin: 0 100px;
|
||||||
|
line-height: 1.3;
|
||||||
|
visibility: visible;
|
||||||
|
padding: 4px 6px;
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<link id='-gd-engine-icon' rel='icon' type='image/png' href='index.icon.png' />
|
||||||
|
<link rel='apple-touch-icon' href='index.apple-touch-icon.png'/>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<canvas id='canvas'>
|
||||||
|
HTML5 canvas appears to be unsupported in the current browser.<br />
|
||||||
|
Please try updating or use a different browser.
|
||||||
|
</canvas>
|
||||||
|
<div id='status'>
|
||||||
|
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
|
||||||
|
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
|
<div id='status-notice' class='godot' style='display: none;'></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type='text/javascript' src='index.js'></script>
|
||||||
|
<script type='text/javascript'>//<![CDATA[
|
||||||
|
|
||||||
|
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":11342752,"index.wasm":13789463},"focusCanvas":true,"gdnativeLibs":[]};
|
||||||
|
var engine = new Engine(GODOT_CONFIG);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
const INDETERMINATE_STATUS_STEP_MS = 100;
|
||||||
|
var statusProgress = document.getElementById('status-progress');
|
||||||
|
var statusProgressInner = document.getElementById('status-progress-inner');
|
||||||
|
var statusIndeterminate = document.getElementById('status-indeterminate');
|
||||||
|
var statusNotice = document.getElementById('status-notice');
|
||||||
|
|
||||||
|
var initializing = true;
|
||||||
|
var statusMode = 'hidden';
|
||||||
|
|
||||||
|
var animationCallbacks = [];
|
||||||
|
function animate(time) {
|
||||||
|
animationCallbacks.forEach(callback => callback(time));
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
}
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
|
||||||
|
function setStatusMode(mode) {
|
||||||
|
|
||||||
|
if (statusMode === mode || !initializing)
|
||||||
|
return;
|
||||||
|
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
|
||||||
|
elem.style.display = 'none';
|
||||||
|
});
|
||||||
|
animationCallbacks = animationCallbacks.filter(function(value) {
|
||||||
|
return (value != animateStatusIndeterminate);
|
||||||
|
});
|
||||||
|
switch (mode) {
|
||||||
|
case 'progress':
|
||||||
|
statusProgress.style.display = 'block';
|
||||||
|
break;
|
||||||
|
case 'indeterminate':
|
||||||
|
statusIndeterminate.style.display = 'block';
|
||||||
|
animationCallbacks.push(animateStatusIndeterminate);
|
||||||
|
break;
|
||||||
|
case 'notice':
|
||||||
|
statusNotice.style.display = 'block';
|
||||||
|
break;
|
||||||
|
case 'hidden':
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error('Invalid status mode');
|
||||||
|
}
|
||||||
|
statusMode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
function animateStatusIndeterminate(ms) {
|
||||||
|
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
|
||||||
|
if (statusIndeterminate.children[i].style.borderTopColor == '') {
|
||||||
|
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
|
||||||
|
child.style.borderTopColor = '';
|
||||||
|
});
|
||||||
|
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setStatusNotice(text) {
|
||||||
|
while (statusNotice.lastChild) {
|
||||||
|
statusNotice.removeChild(statusNotice.lastChild);
|
||||||
|
}
|
||||||
|
var lines = text.split('\n');
|
||||||
|
lines.forEach((line) => {
|
||||||
|
statusNotice.appendChild(document.createTextNode(line));
|
||||||
|
statusNotice.appendChild(document.createElement('br'));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function displayFailureNotice(err) {
|
||||||
|
var msg = err.message || err;
|
||||||
|
console.error(msg);
|
||||||
|
setStatusNotice(msg);
|
||||||
|
setStatusMode('notice');
|
||||||
|
initializing = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!Engine.isWebGLAvailable()) {
|
||||||
|
displayFailureNotice('WebGL not available');
|
||||||
|
} else {
|
||||||
|
setStatusMode('indeterminate');
|
||||||
|
engine.startGame({
|
||||||
|
'onProgress': function (current, total) {
|
||||||
|
if (total > 0) {
|
||||||
|
statusProgressInner.style.width = current/total * 100 + '%';
|
||||||
|
setStatusMode('progress');
|
||||||
|
if (current === total) {
|
||||||
|
// wait for progress bar animation
|
||||||
|
setTimeout(() => {
|
||||||
|
setStatusMode('indeterminate');
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setStatusMode('indeterminate');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}).then(() => {
|
||||||
|
setStatusMode('hidden');
|
||||||
|
initializing = false;
|
||||||
|
}, displayFailureNotice);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
//]]></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="d3b8e1b6f28750540001384a4dae6073"
|
||||||
|
dest_md5="13f329af143fe51772e631f58386f355"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="dac424961c13cbf6f62c6dbf45aee29b"
|
||||||
|
dest_md5="c08cde08724fba167aa5b1f68c78e4da"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="d72436f33cb482560d1014f65468c3af"
|
||||||
|
dest_md5="b4d6d8f2187a7ab945376ae3cc9f794a"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="914e8af982a26c54bd0c20e5da9c58f1"
|
||||||
|
dest_md5="6ebfea520ca23d920a9f55cb931d3f00"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="83a4c00ec3566a6993e9e02ca3be991a"
|
||||||
|
dest_md5="7b7e0ca976b7dabe832cc005f3c46ead"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="dfe59b9b696bbc6f80a14472847fadd4"
|
||||||
|
dest_md5="5040637b1f76615484949228153ed061"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="74c8cd32fc67386b042e86df2b94813d"
|
||||||
|
dest_md5="173f05f114a919f048952aa6e3d95f5f"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="dc108b7636207265771d15cc4add06e5"
|
||||||
|
dest_md5="adee137b71ca1826e3392da7addda26f"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="581ed0a3402b7712f04f6538e960baf0"
|
||||||
|
dest_md5="e542453df2dc90e422fd9fa4ddcf33bd"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="d3e3c3068e0aef308f5da8d9cd5128c0"
|
||||||
|
dest_md5="fee91571c56b13830d2479e8fbdddcae"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="1f483e9e7e3042c95c6fae879421e21b"
|
||||||
|
dest_md5="e1d6075bee16f2080f8b70c395a173a9"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="e810e104de7d06db1e6e5c13bdf9ae75"
|
||||||
|
dest_md5="ba08252ff99c8f1a532f2c6beb56f878"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="8033e5afb60c6510d30ff67ee88a9b49"
|
||||||
|
dest_md5="2e608f11672f12e468dacb2122d6a0c6"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="4e7e9d32491b82f79cc3a3031de580c7"
|
||||||
|
dest_md5="7f3ee09ee73531ad13406fec89f7a0d9"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="e50d59ad56ece23462abdf4641ff33d3"
|
||||||
|
dest_md5="d1a1a9c1229e54f0f63a23bb8df95dfa"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="e5ba347e9198ce16ff1f504649e69f91"
|
||||||
|
dest_md5="d382eadc322f74a09366fcbe2ab70baa"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="92b8fdc59064743cfc0477ad9b1752b0"
|
||||||
|
dest_md5="aa4e2a2c803c3e2ef61ba4f882655088"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="1a7e02294591a053634f66b57ebff1ef"
|
||||||
|
dest_md5="aa10e8729e11477970392a88e4b65b85"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="53c15f8f32e4668c86a6c240c599a580"
|
||||||
|
dest_md5="9013df52a7a260148df80bd016d0fb62"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="c9e110f57aedb2189b68c53469c2b4ab"
|
||||||
|
dest_md5="ae3ad257f76e8af3c3a8e5da733db499"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="57901306bb9b7440b22b19f5b2ae99a8"
|
||||||
|
dest_md5="9c44147b0305dec3b5b6c16e0fda843e"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="870b051e2003343fea95e26cedb0508c"
|
||||||
|
dest_md5="7f51da2eb9175c6118ad9a2f63b75335"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="65233b7cd54d81bb8534ff7be288da8f"
|
||||||
|
dest_md5="b670a767da2b5338e00848146f6afee2"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="6728428a1290e00c2469da8c8ef6858d"
|
||||||
|
dest_md5="c18097f5b0f208985541e5e3ab0d68ce"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="0a32728291ccf1630aa58ef61df2b6ce"
|
||||||
|
dest_md5="a237a9555ba876df93761735246d97dd"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="bd5d2d2ed8f2e567bd0096ccdbea13df"
|
||||||
|
dest_md5="73941f9856f385ccf29e613b2cf5d0ed"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="e61701176ef35b0eddd74a9b61f86e2c"
|
||||||
|
dest_md5="eef1804e29af263c154f8a8bc2287aa1"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="88c7597f9d0a5e8d9b8eb3710e94d5be"
|
||||||
|
dest_md5="1a2a0cb1278d7b58626b612852ac8bcf"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="9b6c3d113ded39de7ad66631bb813271"
|
||||||
|
dest_md5="46f4585f50787ad9057763956c4c867a"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="db6f486877067ebc6208ecd2e94c9c95"
|
||||||
|
dest_md5="f2d3ae3e1577e658a3ee3ad735c8e357"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
source_md5="ffec06162617d64beb48285e3c6088e9"
|
||||||
|
dest_md5="e273b01f84a0f0a455ed08ea5f5ee2ec"
|
||||||
|
|