summaryrefslogtreecommitdiff
path: root/webhogg/wasm/pkg/main.js
diff options
context:
space:
mode:
authornatrixaeria <janng@gmx.de>2019-06-12 16:59:09 +0200
committernatrixaeria <janng@gmx.de>2019-06-12 16:59:09 +0200
commit1b6a2835e57a7d399f43ecf493060e68042f9af8 (patch)
treee9f71720f03064c10876a9afa5ab406c00838d10 /webhogg/wasm/pkg/main.js
parent3a3d0fc3d4733f8908e23a03f860d76340479ec4 (diff)
Clone the colored logging from old commit
Diffstat (limited to 'webhogg/wasm/pkg/main.js')
-rw-r--r--webhogg/wasm/pkg/main.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/webhogg/wasm/pkg/main.js b/webhogg/wasm/pkg/main.js
index eec740d..ce96ee5 100644
--- a/webhogg/wasm/pkg/main.js
+++ b/webhogg/wasm/pkg/main.js
@@ -1,9 +1,13 @@
async function main() {
let fetchingSource = fetch('bin/webhogg-wasm.wasm');
let fetchedSource = await fetchingSource;
- let source = await fetchedSource.text();
- //alert(source)
- let workerGraphics = new Worker('pkg/worker-graphics.js');
-}
+ source = await fetchedSource.arrayBuffer();
+ let workers = [];
+ for (var type of ['graphics', 'logic']) {
+ let worker = new Worker('pkg/worker.js');
+ worker.postMessage([type, source]);
+ workers.push(worker);
+ }
+}
main();