• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision25717ea3e630c6053a4db503332bddca8c719454 (tree)
Zeit2020-03-23 23:27:11
Autorshimitei <shimitei@gmai...>
Commitershimitei

Log Message

Web workerで動かす

表示はとりあえずconsoleへ

Ändern Zusammenfassung

Diff

--- a/src/main-wasm-term.c
+++ b/src/main-wasm-term.c
@@ -1,5 +1,6 @@
11 /* File: main-wasm-term.c */
22
3+#include <emscripten.h>
34 #include "angband.h"
45
56 /*
@@ -70,6 +71,10 @@ static void Term_nuke_wasm(term* t)
7071 static errr Term_text_wasm(int x, int y, int n, byte a, concptr s)
7172 {
7273 printf("%s", s);
74+ EM_ASM({
75+ var s = UTF8ToString($0);
76+ console.log(s);
77+ }, s);
7378
7479 /* Success */
7580 return (0);
--- /dev/null
+++ b/webworker.html
@@ -0,0 +1,11 @@
1+<html>
2+<script>
3+var worker = new Worker("hengband.js");
4+worker.onerror = function (e) {
5+ console.log(e);
6+}
7+worker.onmessage = function (e) {
8+ console.log(e.data);
9+}
10+</script>
11+</html>>
\ No newline at end of file