Spaces:
Running
Running
initial import
Browse files- .gitattributes +2 -0
- index.apple-touch-icon.png +0 -0
- index.audio.worklet.js +211 -0
- index.html +244 -21
- index.icon.png +0 -0
- index.js +0 -0
- index.pck +3 -0
- index.png +0 -0
- index.wasm +3 -0
- index.worker.js +1 -0
- style.css +0 -28
.gitattributes
CHANGED
@@ -25,3 +25,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.pck filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
index.apple-touch-icon.png
ADDED
index.audio.worklet.js
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*************************************************************************/
|
2 |
+
/* audio.worklet.js */
|
3 |
+
/*************************************************************************/
|
4 |
+
/* This file is part of: */
|
5 |
+
/* GODOT ENGINE */
|
6 |
+
/* https://godotengine.org */
|
7 |
+
/*************************************************************************/
|
8 |
+
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
9 |
+
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
10 |
+
/* */
|
11 |
+
/* Permission is hereby granted, free of charge, to any person obtaining */
|
12 |
+
/* a copy of this software and associated documentation files (the */
|
13 |
+
/* "Software"), to deal in the Software without restriction, including */
|
14 |
+
/* without limitation the rights to use, copy, modify, merge, publish, */
|
15 |
+
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
16 |
+
/* permit persons to whom the Software is furnished to do so, subject to */
|
17 |
+
/* the following conditions: */
|
18 |
+
/* */
|
19 |
+
/* The above copyright notice and this permission notice shall be */
|
20 |
+
/* included in all copies or substantial portions of the Software. */
|
21 |
+
/* */
|
22 |
+
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
23 |
+
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
24 |
+
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
25 |
+
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
26 |
+
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
27 |
+
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
28 |
+
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
29 |
+
/*************************************************************************/
|
30 |
+
|
31 |
+
class RingBuffer {
|
32 |
+
constructor(p_buffer, p_state, p_threads) {
|
33 |
+
this.buffer = p_buffer;
|
34 |
+
this.avail = p_state;
|
35 |
+
this.threads = p_threads;
|
36 |
+
this.rpos = 0;
|
37 |
+
this.wpos = 0;
|
38 |
+
}
|
39 |
+
|
40 |
+
data_left() {
|
41 |
+
return this.threads ? Atomics.load(this.avail, 0) : this.avail;
|
42 |
+
}
|
43 |
+
|
44 |
+
space_left() {
|
45 |
+
return this.buffer.length - this.data_left();
|
46 |
+
}
|
47 |
+
|
48 |
+
read(output) {
|
49 |
+
const size = this.buffer.length;
|
50 |
+
let from = 0;
|
51 |
+
let to_write = output.length;
|
52 |
+
if (this.rpos + to_write > size) {
|
53 |
+
const high = size - this.rpos;
|
54 |
+
output.set(this.buffer.subarray(this.rpos, size));
|
55 |
+
from = high;
|
56 |
+
to_write -= high;
|
57 |
+
this.rpos = 0;
|
58 |
+
}
|
59 |
+
if (to_write) {
|
60 |
+
output.set(this.buffer.subarray(this.rpos, this.rpos + to_write), from);
|
61 |
+
}
|
62 |
+
this.rpos += to_write;
|
63 |
+
if (this.threads) {
|
64 |
+
Atomics.add(this.avail, 0, -output.length);
|
65 |
+
Atomics.notify(this.avail, 0);
|
66 |
+
} else {
|
67 |
+
this.avail -= output.length;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
write(p_buffer) {
|
72 |
+
const to_write = p_buffer.length;
|
73 |
+
const mw = this.buffer.length - this.wpos;
|
74 |
+
if (mw >= to_write) {
|
75 |
+
this.buffer.set(p_buffer, this.wpos);
|
76 |
+
this.wpos += to_write;
|
77 |
+
if (mw === to_write) {
|
78 |
+
this.wpos = 0;
|
79 |
+
}
|
80 |
+
} else {
|
81 |
+
const high = p_buffer.subarray(0, mw);
|
82 |
+
const low = p_buffer.subarray(mw);
|
83 |
+
this.buffer.set(high, this.wpos);
|
84 |
+
this.buffer.set(low);
|
85 |
+
this.wpos = low.length;
|
86 |
+
}
|
87 |
+
if (this.threads) {
|
88 |
+
Atomics.add(this.avail, 0, to_write);
|
89 |
+
Atomics.notify(this.avail, 0);
|
90 |
+
} else {
|
91 |
+
this.avail += to_write;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
class GodotProcessor extends AudioWorkletProcessor {
|
97 |
+
constructor() {
|
98 |
+
super();
|
99 |
+
this.threads = false;
|
100 |
+
this.running = true;
|
101 |
+
this.lock = null;
|
102 |
+
this.notifier = null;
|
103 |
+
this.output = null;
|
104 |
+
this.output_buffer = new Float32Array();
|
105 |
+
this.input = null;
|
106 |
+
this.input_buffer = new Float32Array();
|
107 |
+
this.port.onmessage = (event) => {
|
108 |
+
const cmd = event.data['cmd'];
|
109 |
+
const data = event.data['data'];
|
110 |
+
this.parse_message(cmd, data);
|
111 |
+
};
|
112 |
+
}
|
113 |
+
|
114 |
+
process_notify() {
|
115 |
+
if (this.notifier) {
|
116 |
+
Atomics.add(this.notifier, 0, 1);
|
117 |
+
Atomics.notify(this.notifier, 0);
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
parse_message(p_cmd, p_data) {
|
122 |
+
if (p_cmd === 'start' && p_data) {
|
123 |
+
const state = p_data[0];
|
124 |
+
let idx = 0;
|
125 |
+
this.threads = true;
|
126 |
+
this.lock = state.subarray(idx, ++idx);
|
127 |
+
this.notifier = state.subarray(idx, ++idx);
|
128 |
+
const avail_in = state.subarray(idx, ++idx);
|
129 |
+
const avail_out = state.subarray(idx, ++idx);
|
130 |
+
this.input = new RingBuffer(p_data[1], avail_in, true);
|
131 |
+
this.output = new RingBuffer(p_data[2], avail_out, true);
|
132 |
+
} else if (p_cmd === 'stop') {
|
133 |
+
this.running = false;
|
134 |
+
this.output = null;
|
135 |
+
this.input = null;
|
136 |
+
} else if (p_cmd === 'start_nothreads') {
|
137 |
+
this.output = new RingBuffer(p_data[0], p_data[0].length, false);
|
138 |
+
} else if (p_cmd === 'chunk') {
|
139 |
+
this.output.write(p_data);
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
static array_has_data(arr) {
|
144 |
+
return arr.length && arr[0].length && arr[0][0].length;
|
145 |
+
}
|
146 |
+
|
147 |
+
process(inputs, outputs, parameters) {
|
148 |
+
if (!this.running) {
|
149 |
+
return false; // Stop processing.
|
150 |
+
}
|
151 |
+
if (this.output === null) {
|
152 |
+
return true; // Not ready yet, keep processing.
|
153 |
+
}
|
154 |
+
const process_input = GodotProcessor.array_has_data(inputs);
|
155 |
+
if (process_input) {
|
156 |
+
const input = inputs[0];
|
157 |
+
const chunk = input[0].length * input.length;
|
158 |
+
if (this.input_buffer.length !== chunk) {
|
159 |
+
this.input_buffer = new Float32Array(chunk);
|
160 |
+
}
|
161 |
+
if (!this.threads) {
|
162 |
+
GodotProcessor.write_input(this.input_buffer, input);
|
163 |
+
this.port.postMessage({ 'cmd': 'input', 'data': this.input_buffer });
|
164 |
+
} else if (this.input.space_left() >= chunk) {
|
165 |
+
GodotProcessor.write_input(this.input_buffer, input);
|
166 |
+
this.input.write(this.input_buffer);
|
167 |
+
} else {
|
168 |
+
this.port.postMessage('Input buffer is full! Skipping input frame.');
|
169 |
+
}
|
170 |
+
}
|
171 |
+
const process_output = GodotProcessor.array_has_data(outputs);
|
172 |
+
if (process_output) {
|
173 |
+
const output = outputs[0];
|
174 |
+
const chunk = output[0].length * output.length;
|
175 |
+
if (this.output_buffer.length !== chunk) {
|
176 |
+
this.output_buffer = new Float32Array(chunk);
|
177 |
+
}
|
178 |
+
if (this.output.data_left() >= chunk) {
|
179 |
+
this.output.read(this.output_buffer);
|
180 |
+
GodotProcessor.write_output(output, this.output_buffer);
|
181 |
+
if (!this.threads) {
|
182 |
+
this.port.postMessage({ 'cmd': 'read', 'data': chunk });
|
183 |
+
}
|
184 |
+
} else {
|
185 |
+
this.port.postMessage('Output buffer has not enough frames! Skipping output frame.');
|
186 |
+
}
|
187 |
+
}
|
188 |
+
this.process_notify();
|
189 |
+
return true;
|
190 |
+
}
|
191 |
+
|
192 |
+
static write_output(dest, source) {
|
193 |
+
const channels = dest.length;
|
194 |
+
for (let ch = 0; ch < channels; ch++) {
|
195 |
+
for (let sample = 0; sample < dest[ch].length; sample++) {
|
196 |
+
dest[ch][sample] = source[sample * channels + ch];
|
197 |
+
}
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
static write_input(dest, source) {
|
202 |
+
const channels = source.length;
|
203 |
+
for (let ch = 0; ch < channels; ch++) {
|
204 |
+
for (let sample = 0; sample < source[ch].length; sample++) {
|
205 |
+
dest[sample * channels + ch] = source[ch][sample];
|
206 |
+
}
|
207 |
+
}
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
registerProcessor('godot-processor', GodotProcessor);
|
index.html
CHANGED
@@ -1,24 +1,247 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
</div>
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
</html>
|
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
|
3 |
+
<head>
|
4 |
+
<meta charset='utf-8' />
|
5 |
+
<meta name='viewport' content='width=device-width, user-scalable=no' />
|
6 |
+
<title>dodge_3.2x</title>
|
7 |
+
<style type='text/css'>
|
8 |
+
|
9 |
+
body {
|
10 |
+
touch-action: none;
|
11 |
+
margin: 0;
|
12 |
+
border: 0 none;
|
13 |
+
padding: 0;
|
14 |
+
text-align: center;
|
15 |
+
background-color: black;
|
16 |
+
}
|
17 |
+
|
18 |
+
#canvas {
|
19 |
+
display: block;
|
20 |
+
margin: 0;
|
21 |
+
color: white;
|
22 |
+
}
|
23 |
+
|
24 |
+
#canvas:focus {
|
25 |
+
outline: none;
|
26 |
+
}
|
27 |
+
|
28 |
+
.godot {
|
29 |
+
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
|
30 |
+
color: #e0e0e0;
|
31 |
+
background-color: #3b3943;
|
32 |
+
background-image: linear-gradient(to bottom, #403e48, #35333c);
|
33 |
+
border: 1px solid #45434e;
|
34 |
+
box-shadow: 0 0 1px 1px #2f2d35;
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
+
/* Status display
|
39 |
+
* ============== */
|
40 |
+
|
41 |
+
#status {
|
42 |
+
position: absolute;
|
43 |
+
left: 0;
|
44 |
+
top: 0;
|
45 |
+
right: 0;
|
46 |
+
bottom: 0;
|
47 |
+
display: flex;
|
48 |
+
justify-content: center;
|
49 |
+
align-items: center;
|
50 |
+
/* don't consume click events - make children visible explicitly */
|
51 |
+
visibility: hidden;
|
52 |
+
}
|
53 |
+
|
54 |
+
#status-progress {
|
55 |
+
width: 366px;
|
56 |
+
height: 7px;
|
57 |
+
background-color: #38363A;
|
58 |
+
border: 1px solid #444246;
|
59 |
+
padding: 1px;
|
60 |
+
box-shadow: 0 0 2px 1px #1B1C22;
|
61 |
+
border-radius: 2px;
|
62 |
+
visibility: visible;
|
63 |
+
}
|
64 |
+
|
65 |
+
@media only screen and (orientation:portrait) {
|
66 |
+
#status-progress {
|
67 |
+
width: 61.8%;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
#status-progress-inner {
|
72 |
+
height: 100%;
|
73 |
+
width: 0;
|
74 |
+
box-sizing: border-box;
|
75 |
+
transition: width 0.5s linear;
|
76 |
+
background-color: #202020;
|
77 |
+
border: 1px solid #222223;
|
78 |
+
box-shadow: 0 0 1px 1px #27282E;
|
79 |
+
border-radius: 3px;
|
80 |
+
}
|
81 |
+
|
82 |
+
#status-indeterminate {
|
83 |
+
visibility: visible;
|
84 |
+
position: relative;
|
85 |
+
}
|
86 |
+
|
87 |
+
#status-indeterminate > div {
|
88 |
+
width: 4.5px;
|
89 |
+
height: 0;
|
90 |
+
border-style: solid;
|
91 |
+
border-width: 9px 3px 0 3px;
|
92 |
+
border-color: #2b2b2b transparent transparent transparent;
|
93 |
+
transform-origin: center 21px;
|
94 |
+
position: absolute;
|
95 |
+
}
|
96 |
+
|
97 |
+
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
|
98 |
+
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
|
99 |
+
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
|
100 |
+
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
|
101 |
+
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
|
102 |
+
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
|
103 |
+
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
|
104 |
+
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
|
105 |
+
|
106 |
+
#status-notice {
|
107 |
+
margin: 0 100px;
|
108 |
+
line-height: 1.3;
|
109 |
+
visibility: visible;
|
110 |
+
padding: 4px 6px;
|
111 |
+
visibility: visible;
|
112 |
+
}
|
113 |
+
</style>
|
114 |
+
<link id='-gd-engine-icon' rel='icon' type='image/png' href='index.icon.png' />
|
115 |
+
<link rel='apple-touch-icon' href='index.apple-touch-icon.png'/>
|
116 |
+
|
117 |
+
</head>
|
118 |
+
<body>
|
119 |
+
<canvas id='canvas'>
|
120 |
+
HTML5 canvas appears to be unsupported in the current browser.<br />
|
121 |
+
Please try updating or use a different browser.
|
122 |
+
</canvas>
|
123 |
+
<div id='status'>
|
124 |
+
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
|
125 |
+
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
|
126 |
+
<div></div>
|
127 |
+
<div></div>
|
128 |
+
<div></div>
|
129 |
+
<div></div>
|
130 |
+
<div></div>
|
131 |
+
<div></div>
|
132 |
+
<div></div>
|
133 |
+
<div></div>
|
134 |
</div>
|
135 |
+
<div id='status-notice' class='godot' style='display: none;'></div>
|
136 |
+
</div>
|
137 |
+
|
138 |
+
<script type='text/javascript' src='index.js'></script>
|
139 |
+
<script type='text/javascript'>//<![CDATA[
|
140 |
+
|
141 |
+
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":2137488,"index.wasm":17832873},"focusCanvas":true,"gdnativeLibs":[]};
|
142 |
+
var engine = new Engine(GODOT_CONFIG);
|
143 |
+
|
144 |
+
(function() {
|
145 |
+
const INDETERMINATE_STATUS_STEP_MS = 100;
|
146 |
+
var statusProgress = document.getElementById('status-progress');
|
147 |
+
var statusProgressInner = document.getElementById('status-progress-inner');
|
148 |
+
var statusIndeterminate = document.getElementById('status-indeterminate');
|
149 |
+
var statusNotice = document.getElementById('status-notice');
|
150 |
+
|
151 |
+
var initializing = true;
|
152 |
+
var statusMode = 'hidden';
|
153 |
+
|
154 |
+
var animationCallbacks = [];
|
155 |
+
function animate(time) {
|
156 |
+
animationCallbacks.forEach(callback => callback(time));
|
157 |
+
requestAnimationFrame(animate);
|
158 |
+
}
|
159 |
+
requestAnimationFrame(animate);
|
160 |
+
|
161 |
+
function setStatusMode(mode) {
|
162 |
+
|
163 |
+
if (statusMode === mode || !initializing)
|
164 |
+
return;
|
165 |
+
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
|
166 |
+
elem.style.display = 'none';
|
167 |
+
});
|
168 |
+
animationCallbacks = animationCallbacks.filter(function(value) {
|
169 |
+
return (value != animateStatusIndeterminate);
|
170 |
+
});
|
171 |
+
switch (mode) {
|
172 |
+
case 'progress':
|
173 |
+
statusProgress.style.display = 'block';
|
174 |
+
break;
|
175 |
+
case 'indeterminate':
|
176 |
+
statusIndeterminate.style.display = 'block';
|
177 |
+
animationCallbacks.push(animateStatusIndeterminate);
|
178 |
+
break;
|
179 |
+
case 'notice':
|
180 |
+
statusNotice.style.display = 'block';
|
181 |
+
break;
|
182 |
+
case 'hidden':
|
183 |
+
break;
|
184 |
+
default:
|
185 |
+
throw new Error('Invalid status mode');
|
186 |
+
}
|
187 |
+
statusMode = mode;
|
188 |
+
}
|
189 |
+
|
190 |
+
function animateStatusIndeterminate(ms) {
|
191 |
+
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
|
192 |
+
if (statusIndeterminate.children[i].style.borderTopColor == '') {
|
193 |
+
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
|
194 |
+
child.style.borderTopColor = '';
|
195 |
+
});
|
196 |
+
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
function setStatusNotice(text) {
|
201 |
+
while (statusNotice.lastChild) {
|
202 |
+
statusNotice.removeChild(statusNotice.lastChild);
|
203 |
+
}
|
204 |
+
var lines = text.split('\n');
|
205 |
+
lines.forEach((line) => {
|
206 |
+
statusNotice.appendChild(document.createTextNode(line));
|
207 |
+
statusNotice.appendChild(document.createElement('br'));
|
208 |
+
});
|
209 |
+
};
|
210 |
+
|
211 |
+
function displayFailureNotice(err) {
|
212 |
+
var msg = err.message || err;
|
213 |
+
console.error(msg);
|
214 |
+
setStatusNotice(msg);
|
215 |
+
setStatusMode('notice');
|
216 |
+
initializing = false;
|
217 |
+
};
|
218 |
+
|
219 |
+
if (!Engine.isWebGLAvailable()) {
|
220 |
+
displayFailureNotice('WebGL not available');
|
221 |
+
} else {
|
222 |
+
setStatusMode('indeterminate');
|
223 |
+
engine.startGame({
|
224 |
+
'onProgress': function (current, total) {
|
225 |
+
if (total > 0) {
|
226 |
+
statusProgressInner.style.width = current/total * 100 + '%';
|
227 |
+
setStatusMode('progress');
|
228 |
+
if (current === total) {
|
229 |
+
// wait for progress bar animation
|
230 |
+
setTimeout(() => {
|
231 |
+
setStatusMode('indeterminate');
|
232 |
+
}, 500);
|
233 |
+
}
|
234 |
+
} else {
|
235 |
+
setStatusMode('indeterminate');
|
236 |
+
}
|
237 |
+
},
|
238 |
+
}).then(() => {
|
239 |
+
setStatusMode('hidden');
|
240 |
+
initializing = false;
|
241 |
+
}, displayFailureNotice);
|
242 |
+
}
|
243 |
+
})();
|
244 |
+
//]]></script>
|
245 |
+
</body>
|
246 |
</html>
|
247 |
+
|
index.icon.png
ADDED
index.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
index.pck
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7aab64929830b40b70a02edfe759471bc7f6a50116e6b1021303406554a28e23
|
3 |
+
size 2137488
|
index.png
ADDED
index.wasm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9c8308410a49138e98e4ff92a67f224d1052df6529216fdc9d53cef8cd9702c0
|
3 |
+
size 17832873
|
index.worker.js
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
"use strict";var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}Godot(Module).then(function(instance){Module=instance;moduleLoaded()})}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};
|
style.css
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
body {
|
2 |
-
padding: 2rem;
|
3 |
-
font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
|
4 |
-
}
|
5 |
-
|
6 |
-
h1 {
|
7 |
-
font-size: 16px;
|
8 |
-
margin-top: 0;
|
9 |
-
}
|
10 |
-
|
11 |
-
p {
|
12 |
-
color: rgb(107, 114, 128);
|
13 |
-
font-size: 15px;
|
14 |
-
margin-bottom: 10px;
|
15 |
-
margin-top: 5px;
|
16 |
-
}
|
17 |
-
|
18 |
-
.card {
|
19 |
-
max-width: 620px;
|
20 |
-
margin: 0 auto;
|
21 |
-
padding: 16px;
|
22 |
-
border: 1px solid lightgray;
|
23 |
-
border-radius: 16px;
|
24 |
-
}
|
25 |
-
|
26 |
-
.card p:last-child {
|
27 |
-
margin-bottom: 0;
|
28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|