summaryrefslogtreecommitdiff
path: root/webhogg/wasm/pkg/worker.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/worker.js
parent3a3d0fc3d4733f8908e23a03f860d76340479ec4 (diff)
Clone the colored logging from old commit
Diffstat (limited to 'webhogg/wasm/pkg/worker.js')
-rw-r--r--webhogg/wasm/pkg/worker.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/webhogg/wasm/pkg/worker.js b/webhogg/wasm/pkg/worker.js
new file mode 100644
index 0000000..bd11676
--- /dev/null
+++ b/webhogg/wasm/pkg/worker.js
@@ -0,0 +1,9 @@
+onmessage = async function (e) {
+ importScripts('../bin/webhogg-wasm.js');
+ let ctx = await wasm_bindgen(e.data[1]);
+
+ if (e.data[0] === 'graphics')
+ ctx.start_graphics();
+ else if (e.data[0] === 'logic')
+ ctx.start_logic();
+}