Browse Source

removed npm

Inderjit Gill 8 months ago
parent
commit
272164ac21

+ 3
- 6
.gitignore View File

@@ -1,9 +1,6 @@
1 1
 /assets/research
2
-
3
-/client/target
4
-/client/www/dist
5
-/client/www/node_modules
6
-
7 2
 /core/target
8
-
9 3
 /server/target
4
+/client/target
5
+/client/www/sokoban_client.js
6
+/client/www/sokoban_client_bg.wasm

+ 79
- 99
client/Cargo.lock View File

@@ -4,7 +4,7 @@ version = "0.3.9"
4 4
 source = "registry+https://github.com/rust-lang/crates.io-index"
5 5
 dependencies = [
6 6
  "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)",
7
- "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
7
+ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
8 8
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
9 9
  "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
10 10
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -26,7 +26,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
26 26
 
27 27
 [[package]]
28 28
 name = "cfg-if"
29
-version = "0.1.5"
29
+version = "0.1.6"
30 30
 source = "registry+https://github.com/rust-lang/crates.io-index"
31 31
 
32 32
 [[package]]
@@ -34,28 +34,28 @@ name = "console_error_panic_hook"
34 34
 version = "0.1.5"
35 35
 source = "registry+https://github.com/rust-lang/crates.io-index"
36 36
 dependencies = [
37
- "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
38
- "wasm-bindgen 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
37
+ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
38
+ "wasm-bindgen 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
39 39
 ]
40 40
 
41 41
 [[package]]
42 42
 name = "failure"
43
-version = "0.1.2"
43
+version = "0.1.3"
44 44
 source = "registry+https://github.com/rust-lang/crates.io-index"
45 45
 dependencies = [
46 46
  "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
47
- "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
47
+ "failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
48 48
 ]
49 49
 
50 50
 [[package]]
51 51
 name = "failure_derive"
52
-version = "0.1.2"
52
+version = "0.1.3"
53 53
 source = "registry+https://github.com/rust-lang/crates.io-index"
54 54
 dependencies = [
55
- "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
56
- "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
57
- "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)",
58
- "synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
55
+ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
56
+ "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
57
+ "syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)",
58
+ "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
59 59
 ]
60 60
 
61 61
 [[package]]
@@ -65,19 +65,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
65 65
 
66 66
 [[package]]
67 67
 name = "js-sys"
68
-version = "0.3.4"
68
+version = "0.3.5"
69 69
 source = "registry+https://github.com/rust-lang/crates.io-index"
70 70
 dependencies = [
71
- "wasm-bindgen 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
71
+ "wasm-bindgen 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
72 72
 ]
73 73
 
74 74
 [[package]]
75 75
 name = "lazy_static"
76
-version = "1.1.0"
76
+version = "1.2.0"
77 77
 source = "registry+https://github.com/rust-lang/crates.io-index"
78
-dependencies = [
79
- "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
80
-]
81 78
 
82 79
 [[package]]
83 80
 name = "libc"
@@ -86,10 +83,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
86 83
 
87 84
 [[package]]
88 85
 name = "log"
89
-version = "0.4.5"
86
+version = "0.4.6"
90 87
 source = "registry+https://github.com/rust-lang/crates.io-index"
91 88
 dependencies = [
92
- "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
89
+ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
93 90
 ]
94 91
 
95 92
 [[package]]
@@ -99,7 +96,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
99 96
 
100 97
 [[package]]
101 98
 name = "proc-macro2"
102
-version = "0.4.20"
99
+version = "0.4.24"
103 100
 source = "registry+https://github.com/rust-lang/crates.io-index"
104 101
 dependencies = [
105 102
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -107,10 +104,10 @@ dependencies = [
107 104
 
108 105
 [[package]]
109 106
 name = "quote"
110
-version = "0.6.8"
107
+version = "0.6.10"
111 108
 source = "registry+https://github.com/rust-lang/crates.io-index"
112 109
 dependencies = [
113
- "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
110
+ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
114 111
 ]
115 112
 
116 113
 [[package]]
@@ -127,11 +124,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
127 124
 name = "sokoban-client"
128 125
 version = "0.1.0"
129 126
 dependencies = [
130
- "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
127
+ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
131 128
  "console_error_panic_hook 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
132 129
  "sokoban-core 0.1.0",
133
- "wasm-bindgen 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
134
- "wasm-bindgen-test 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
130
+ "wasm-bindgen 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
131
+ "wasm-bindgen-test 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
135 132
  "wee_alloc 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
136 133
 ]
137 134
 
@@ -139,37 +136,27 @@ dependencies = [
139 136
 name = "sokoban-core"
140 137
 version = "0.1.0"
141 138
 dependencies = [
142
- "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
143
-]
144
-
145
-[[package]]
146
-name = "syn"
147
-version = "0.14.9"
148
-source = "registry+https://github.com/rust-lang/crates.io-index"
149
-dependencies = [
150
- "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
151
- "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
152
- "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
139
+ "failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
153 140
 ]
154 141
 
155 142
 [[package]]
156 143
 name = "syn"
157
-version = "0.15.9"
144
+version = "0.15.21"
158 145
 source = "registry+https://github.com/rust-lang/crates.io-index"
159 146
 dependencies = [
160
- "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
161
- "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
147
+ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
148
+ "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
162 149
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
163 150
 ]
164 151
 
165 152
 [[package]]
166 153
 name = "synstructure"
167
-version = "0.9.0"
154
+version = "0.10.1"
168 155
 source = "registry+https://github.com/rust-lang/crates.io-index"
169 156
 dependencies = [
170
- "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
171
- "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
172
- "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)",
157
+ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
158
+ "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
159
+ "syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)",
173 160
  "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
174 161
 ]
175 162
 
@@ -187,93 +174,88 @@ dependencies = [
187 174
 ]
188 175
 
189 176
 [[package]]
190
-name = "version_check"
191
-version = "0.1.5"
192
-source = "registry+https://github.com/rust-lang/crates.io-index"
193
-
194
-[[package]]
195 177
 name = "void"
196 178
 version = "1.0.2"
197 179
 source = "registry+https://github.com/rust-lang/crates.io-index"
198 180
 
199 181
 [[package]]
200 182
 name = "wasm-bindgen"
201
-version = "0.2.27"
183
+version = "0.2.28"
202 184
 source = "registry+https://github.com/rust-lang/crates.io-index"
203 185
 dependencies = [
204
- "wasm-bindgen-macro 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
186
+ "wasm-bindgen-macro 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
205 187
 ]
206 188
 
207 189
 [[package]]
208 190
 name = "wasm-bindgen-backend"
209
-version = "0.2.27"
191
+version = "0.2.28"
210 192
 source = "registry+https://github.com/rust-lang/crates.io-index"
211 193
 dependencies = [
212
- "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
213
- "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
214
- "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
215
- "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
216
- "syn 0.15.9 (registry+https://github.com/rust-lang/crates.io-index)",
217
- "wasm-bindgen-shared 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
194
+ "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
195
+ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
196
+ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
197
+ "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
198
+ "syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)",
199
+ "wasm-bindgen-shared 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
218 200
 ]
219 201
 
220 202
 [[package]]
221 203
 name = "wasm-bindgen-futures"
222
-version = "0.3.4"
204
+version = "0.3.5"
223 205
 source = "registry+https://github.com/rust-lang/crates.io-index"
224 206
 dependencies = [
225 207
  "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
226
- "js-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
227
- "wasm-bindgen 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
208
+ "js-sys 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
209
+ "wasm-bindgen 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
228 210
 ]
229 211
 
230 212
 [[package]]
231 213
 name = "wasm-bindgen-macro"
232
-version = "0.2.27"
214
+version = "0.2.28"
233 215
 source = "registry+https://github.com/rust-lang/crates.io-index"
234 216
 dependencies = [
235
- "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
236
- "wasm-bindgen-macro-support 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
217
+ "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
218
+ "wasm-bindgen-macro-support 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
237 219
 ]
238 220
 
239 221
 [[package]]
240 222
 name = "wasm-bindgen-macro-support"
241
-version = "0.2.27"
223
+version = "0.2.28"
242 224
 source = "registry+https://github.com/rust-lang/crates.io-index"
243 225
 dependencies = [
244
- "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
245
- "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
246
- "syn 0.15.9 (registry+https://github.com/rust-lang/crates.io-index)",
247
- "wasm-bindgen-backend 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
248
- "wasm-bindgen-shared 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
226
+ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
227
+ "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
228
+ "syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)",
229
+ "wasm-bindgen-backend 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
230
+ "wasm-bindgen-shared 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
249 231
 ]
250 232
 
251 233
 [[package]]
252 234
 name = "wasm-bindgen-shared"
253
-version = "0.2.27"
235
+version = "0.2.28"
254 236
 source = "registry+https://github.com/rust-lang/crates.io-index"
255 237
 
256 238
 [[package]]
257 239
 name = "wasm-bindgen-test"
258
-version = "0.2.27"
240
+version = "0.2.28"
259 241
 source = "registry+https://github.com/rust-lang/crates.io-index"
260 242
 dependencies = [
261 243
  "console_error_panic_hook 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
262 244
  "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
263
- "js-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
245
+ "js-sys 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
264 246
  "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
265
- "wasm-bindgen 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
266
- "wasm-bindgen-futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
267
- "wasm-bindgen-test-macro 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)",
247
+ "wasm-bindgen 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
248
+ "wasm-bindgen-futures 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
249
+ "wasm-bindgen-test-macro 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)",
268 250
 ]
269 251
 
270 252
 [[package]]
271 253
 name = "wasm-bindgen-test-macro"
272
-version = "0.2.27"
254
+version = "0.2.28"
273 255
 source = "registry+https://github.com/rust-lang/crates.io-index"
274 256
 dependencies = [
275
- "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)",
276
- "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
257
+ "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
258
+ "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
277 259
 ]
278 260
 
279 261
 [[package]]
@@ -281,7 +263,7 @@ name = "wee_alloc"
281 263
 version = "0.4.2"
282 264
 source = "registry+https://github.com/rust-lang/crates.io-index"
283 265
 dependencies = [
284
- "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
266
+ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
285 267
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
286 268
  "memory_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
287 269
  "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -311,35 +293,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
311 293
 "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
312 294
 "checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"
313 295
 "checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16"
314
-"checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3"
296
+"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
315 297
 "checksum console_error_panic_hook 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6c5dd2c094474ec60a6acaf31780af270275e3153bafff2db5995b715295762e"
316
-"checksum failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7efb22686e4a466b1ec1a15c2898f91fa9cb340452496dca654032de20ff95b9"
317
-"checksum failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "946d0e98a50d9831f5d589038d2ca7f8f455b1c21028c0db0e84116a12696426"
298
+"checksum failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7"
299
+"checksum failure_derive 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "64c2d913fe8ed3b6c6518eedf4538255b989945c14c2a7d5cbff62a5e2120596"
318 300
 "checksum futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)" = "49e7653e374fe0d0c12de4250f0bdb60680b8c80eed558c5c7538eec9c89e21b"
319
-"checksum js-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8398e64a4381e93044f63287109e5f1cb65122e63ad2f0607ec6a239d9e13464"
320
-"checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7"
301
+"checksum js-sys 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9f476e674d55cc43a57dfd1d3986c7c305e41827ead21ff6373652804f728afe"
302
+"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
321 303
 "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d"
322
-"checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f"
304
+"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
323 305
 "checksum memory_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3"
324
-"checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee"
325
-"checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5"
306
+"checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09"
307
+"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c"
326 308
 "checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395"
327 309
 "checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28"
328
-"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741"
329
-"checksum syn 0.15.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b10ee269228fb723234fce98e9aac0eaed2bd5f1ad2f6930e8d5b93f04445a1a"
330
-"checksum synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb9b7550d063ea184027c9b8c20ac167cd36d3e06b3a40bceb9d746dc1a7b7"
310
+"checksum syn 0.15.21 (registry+https://github.com/rust-lang/crates.io-index)" = "816b7af21405b011a23554ea2dc3f6576dc86ca557047c34098c1d741f10f823"
311
+"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
331 312
 "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
332 313
 "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
333
-"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
334 314
 "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
335
-"checksum wasm-bindgen 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)" = "ddabe7a233fc293b35f9754067580906c14b5a14b68da67d21ac109f8624c3fe"
336
-"checksum wasm-bindgen-backend 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4420cb4101491fa91a0aa488584bf359ec4d805667982d3de37ad18c1adc6c62"
337
-"checksum wasm-bindgen-futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "510541c3a3e13763785f6066ad8823f522fc214f867c1af9469092a5f740230f"
338
-"checksum wasm-bindgen-macro 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)" = "83b50f7b3fad6acd49da239daf5a7a358c554e94e904549f4fd2d7a34d692fb0"
339
-"checksum wasm-bindgen-macro-support 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)" = "a0970181097265052ae1822d0203412ab7ca5a0f05b8d6581c23ec31e9b99b95"
340
-"checksum wasm-bindgen-shared 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)" = "251fcb2edbdc5baace161ed8ab680c6cd0ff35b50bdf3eb21afb81fd42c0eb78"
341
-"checksum wasm-bindgen-test 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb421c529d70602b52be2ae5bf0260a718e2f69514d3841cb43e094f5c3f0f1"
342
-"checksum wasm-bindgen-test-macro 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)" = "0068543ec0dd625181605c62da925b06e8a3e51aac1c4035943717cb3c91bed2"
315
+"checksum wasm-bindgen 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)" = "dcefd48aa89f1319c61780595be0d378c5de5ccefd9d4e55c282aad4245a256c"
316
+"checksum wasm-bindgen-backend 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)" = "9b12e4c544f22adf78c7bc06fa605ac084566adc88bcbbe8857f0ceb0a12613a"
317
+"checksum wasm-bindgen-futures 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e681f39732ced443d8ae6cc866ba00fdebc4482f6e0e7e96ef0c415681be83d0"
318
+"checksum wasm-bindgen-macro 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c71b31dc194560c8696348975abc32ed134742c19a865601db3d7eb01a1c56"
319
+"checksum wasm-bindgen-macro-support 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)" = "890018bb4a49c4c977c66e0c6a5f633d82766f6e78a57e2bc8f611a22f72dc18"
320
+"checksum wasm-bindgen-shared 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)" = "0e38e79a1881e09015aaf8db197b04d97439e06da0f50a213608e93247f5ecfc"
321
+"checksum wasm-bindgen-test 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)" = "aae7dcae1123854b20b06288ea930153d6fa0fa75948aa0218fb50f81cac1a1d"
322
+"checksum wasm-bindgen-test-macro 0.2.28 (registry+https://github.com/rust-lang/crates.io-index)" = "d7341ddac1babc9790b0647769f772d1dba217c9b16f204a55f82910853dca5b"
343 323
 "checksum wee_alloc 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "27875be1daf838fa18f3e94fd19fd12638e34615b42f56da2610c8f46be80cc6"
344 324
 "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
345 325
 "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"

+ 14
- 0
client/build.sh View File

@@ -0,0 +1,14 @@
1
+#!/bin/sh
2
+
3
+if [ "$1" = "release" ]
4
+then
5
+    cargo +nightly build --release --target wasm32-unknown-unknown
6
+    wasm-bindgen target/wasm32-unknown-unknown/release/sokoban_client.wasm --out-dir www --no-typescript --no-modules
7
+
8
+    sed -i "s/__exports.BridgeConfig = BridgeConfig;/__exports.BridgeConfig = BridgeConfig;\n\/\/ ISG HACK\n__exports.wasm = wasm;/g" www/sokoban_client.js
9
+else
10
+    cargo +nightly build --target wasm32-unknown-unknown
11
+    wasm-bindgen target/wasm32-unknown-unknown/debug/sokoban_client.wasm --out-dir www --no-typescript --no-modules
12
+
13
+    sed -i "s/__exports.BridgeConfig = BridgeConfig;/__exports.BridgeConfig = BridgeConfig;\n\/\/ ISG HACK\n__exports.wasm = wasm;/g" www/sokoban_client.js
14
+fi

+ 0
- 6
client/package.json View File

@@ -1,6 +0,0 @@
1
-{
2
-  "scripts": {
3
-    "build:dev": "cargo +nightly build --target wasm32-unknown-unknown && wasm-bindgen target/wasm32-unknown-unknown/debug/sokoban_client.wasm --out-dir www/wasm --no-typescript --browser",
4
-    "build:release": "cargo +nightly build --release --target wasm32-unknown-unknown && wasm-bindgen target/wasm32-unknown-unknown/release/sokoban_client.wasm --out-dir www/wasm --no-typescript --browser"
5
-  }
6
-}

+ 0
- 5
client/www/bootstrap.js View File

@@ -1,5 +0,0 @@
1
-// A dependency graph that contains any wasm must all be imported
2
-// asynchronously. This `bootstrap.js` file does the single async import, so
3
-// that no one else needs to worry about it again.
4
-import("./index.js")
5
-  .catch(e => console.error("Error importing `index.js`:", e));

BIN
client/www/favicon.ico View File


+ 3003
- 0
client/www/howler.js
File diff suppressed because it is too large
View File


+ 20
- 1
client/www/index.html View File

@@ -22,6 +22,25 @@
22 22
   </head>
23 23
   <body>
24 24
     <canvas id="render-canvas"></canvas>
25
-    <script src='bootstrap.js'></script>
25
+    <script src='howler.js'></script>
26
+
27
+
28
+    <script>
29
+      // The `--no-modules`-generated JS from `wasm-bindgen` attempts to use
30
+      // `WebAssembly.instantiateStreaming` to instantiate the wasm module,
31
+      // but this doesn't work with `file://` urls. This example is frequently
32
+      // viewed by simply opening `index.html` in a browser (with a `file://`
33
+      // url), so it would fail if we were to call this function!
34
+      //
35
+      // Work around this for now by deleting the function to ensure that the
36
+      // `no_modules.js` script doesn't have access to it. You won't need this
37
+      // hack when deploying over HTTP.
38
+      delete WebAssembly.instantiateStreaming;
39
+    </script>
40
+
41
+    <!-- this is the JS generated by the `wasm-bindgen` CLI tool -->
42
+    <script src='./sokoban_client.js'></script>
43
+
44
+    <script src='index.js'></script>
26 45
   </body>
27 46
 </html>

+ 649
- 6
client/www/index.js View File

@@ -1,9 +1,642 @@
1
-import { Bridge, BridgeConfig } from "./wasm/sokoban_client";
2
-import { memory } from "./wasm/sokoban_client_bg";
1
+const { Bridge, BridgeConfig } = wasm_bindgen;
2
+let memory = undefined;
3
+
4
+function matrixCreate() {
5
+  const out = new Float32Array(16);
6
+  out[0] = 1;
7
+  out[1] = 0;
8
+  out[2] = 0;
9
+  out[3] = 0;
10
+  out[4] = 0;
11
+  out[5] = 1;
12
+  out[6] = 0;
13
+  out[7] = 0;
14
+  out[8] = 0;
15
+  out[9] = 0;
16
+  out[10] = 1;
17
+  out[11] = 0;
18
+  out[12] = 0;
19
+  out[13] = 0;
20
+  out[14] = 0;
21
+  out[15] = 1;
22
+
23
+  return out;
24
+}
25
+
26
+function matrixOrtho(out, left, right, bottom, top, near, far) {
27
+  const lr = 1 / (left - right);
28
+  const bt = 1 / (bottom - top);
29
+  const nf = 1 / (near - far);
30
+
31
+  out[0] = -2 * lr;
32
+  out[1] = 0;
33
+  out[2] = 0;
34
+  out[3] = 0;
35
+  out[4] = 0;
36
+  out[5] = -2 * bt;
37
+  out[6] = 0;
38
+  out[7] = 0;
39
+  out[8] = 0;
40
+  out[9] = 0;
41
+  out[10] = 2 * nf;
42
+  out[11] = 0;
43
+  out[12] = (left + right) * lr;
44
+  out[13] = (top + bottom) * bt;
45
+  out[14] = (far + near) * nf;
46
+  out[15] = 1;
47
+
48
+  return out;
49
+}
50
+
51
+const logToConsole = false;
52
+
53
+function memorySubArray(mem, ptr, length) {
54
+  const nByte = 4;
55
+  const pos = ptr / nByte;
56
+  return mem.subarray(pos, pos + length);
57
+}
58
+
59
+function initGL(canvas) {
60
+  try {
61
+    const gl = canvas.getContext('experimental-webgl', {
62
+      alpha: false,
63
+      preserveDrawingBuffer: true
64
+    });
65
+
66
+    if (!gl) {
67
+      alert('Could not initialise WebGL, sorry :-(');
68
+    }
69
+
70
+    return gl;
71
+  } catch (e) {
72
+    return undefined;
73
+  }
74
+}
75
+
76
+function compileShader(gl, type, src) {
77
+  const shader = gl.createShader(type);
78
+  gl.shaderSource(shader, src);
79
+  gl.compileShader(shader);
80
+
81
+  if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
82
+    let lastError = gl.getShaderInfoLog(shader);
83
+    console.log(`Error compiling shader ${shader} : ${lastError}`);
84
+    gl.deleteShader(shader);
85
+    return null;
86
+  }
87
+  return shader;
88
+}
89
+
90
+function setupInGameShader(gl) {
91
+  const shader = {};
92
+
93
+  shader.program = gl.createProgram();
94
+
95
+  const fragmentSrc = `
96
+  precision mediump float;
97
+  varying vec4 vColor;
98
+  varying highp vec2 vTextureCoord;
99
+
100
+  uniform sampler2D uSampler;
101
+
102
+  void main(void) {
103
+    vec4 tex = texture2D(uSampler, vTextureCoord);
104
+
105
+    gl_FragColor.r = tex.r * vColor.a * vColor.r;
106
+    gl_FragColor.g = tex.g * vColor.a * vColor.g;
107
+    gl_FragColor.b = tex.b * vColor.a * vColor.b;
108
+    gl_FragColor.a = tex.a * vColor.a;
109
+
110
+  }
111
+  `;
112
+
113
+  const vertexSrc = `
114
+  attribute vec2 aVertexPosition;
115
+  attribute vec4 aVertexColor;
116
+  attribute vec2 aVertexTexture;
117
+
118
+  uniform mat4 uMVMatrix;
119
+  uniform mat4 uPMatrix;
120
+
121
+  varying vec4 vColor;
122
+  varying highp vec2 vTextureCoord;
123
+
124
+  void main(void) {
125
+    gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 0.0, 1.0);
126
+    vColor = aVertexColor;
127
+    vTextureCoord = aVertexTexture;
128
+  }
129
+  `;
130
+
131
+  const vertexShader = compileShader(gl, gl.VERTEX_SHADER, vertexSrc);
132
+  const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSrc);
133
+
134
+  gl.attachShader(shader.program, vertexShader);
135
+  gl.attachShader(shader.program, fragmentShader);
136
+
137
+  gl.linkProgram(shader.program);
138
+
139
+  if (!gl.getProgramParameter(shader.program, gl.LINK_STATUS)) {
140
+    let lastError = gl.getProgramInfoLog(shader.program);
141
+
142
+    alert(`Could not initialise shaders: ${lastError}`);;
143
+    gl.deleteProgram(shader.program);
144
+    return null;
145
+  }
146
+
147
+  shader.positionLocation = gl.getAttribLocation(shader.program, 'aVertexPosition');
148
+  shader.colourLocation   = gl.getAttribLocation(shader.program, 'aVertexColor');
149
+  shader.texCoordLocation = gl.getAttribLocation(shader.program, 'aVertexTexture');
150
+
151
+  shader.pMatrixLocation  = gl.getUniformLocation(shader.program, 'uPMatrix');
152
+  shader.mvMatrixLocation = gl.getUniformLocation(shader.program, 'uMVMatrix');
153
+  shader.textureLocation  = gl.getUniformLocation(shader.program, 'uSampler');
154
+
155
+  return shader;
156
+}
157
+
158
+function setupCRTShader(gl) {
159
+  const shader = {};
160
+
161
+  shader.program = gl.createProgram();
162
+
163
+  const fragmentSrc = `
164
+  precision highp float;
165
+  varying vec2 tex_coord;
166
+
167
+  uniform sampler2D texture;
168
+  uniform vec2 res;
169
+  uniform vec2 uv_max;
170
+  uniform vec2 warp2;
171
+
172
+  // Amount of shadow mask.
173
+  float maskDark=0.7;
174
+  float maskLight=1.4;
175
+
176
+  // Distortion of scanlines, and end of screen alpha.
177
+  vec2 Warp(vec2 pos) {
178
+    pos = pos * 2.0 - 1.0;
179
+    pos *= vec2(1.0 + (pos.y * pos.y) * warp2.x, 1.0 + (pos.x * pos.x) * warp2.y);
180
+    return pos * 0.5 + 0.5;
181
+  }
182
+
183
+  // Shadow mask.
184
+  vec3 Mask(vec2 pos) {
185
+    pos.x += pos.y * 3.0;
186
+    vec3 mask = vec3(maskDark, maskDark, maskDark);
187
+    pos.x = fract(pos.x / 6.0);
188
+    if (pos.x < 0.333) mask.r = maskLight;
189
+    else if(pos.x < 0.666) mask.g=maskLight;
190
+    else mask.b = maskLight;
191
+    return mask;
192
+  }
193
+
194
+  void main(void) {
195
+    vec2 normalised_tex_coord = tex_coord / uv_max;
196
+    vec2 pos=Warp(normalised_tex_coord);
197
+    pos *= uv_max;
198
+    vec4 tex = texture2D(texture, pos);
199
+
200
+    vec2 pixel = res * pos;
201
+    gl_FragColor.rgb=tex.rgb;// * Mask(pixel.xy);
202
+    gl_FragColor.a = 1.0;
203
+  }
204
+  `;
205
+
206
+  const vertexSrc = `
207
+  attribute vec2 v_pos;
208
+  attribute vec2 v_tex_coord;
209
+
210
+  uniform mat4 m_mv;
211
+  uniform mat4 m_p;
212
+
213
+  varying highp vec2 tex_coord;
214
+
215
+  void main(void) {
216
+    gl_Position = m_p * m_mv * vec4(v_pos, 0.0, 1.0);
217
+    tex_coord = v_tex_coord;
218
+  }
219
+  `;
220
+
221
+  const vertexShader = compileShader(gl, gl.VERTEX_SHADER, vertexSrc);
222
+  const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSrc);
223
+
224
+  gl.attachShader(shader.program, vertexShader);
225
+  gl.attachShader(shader.program, fragmentShader);
226
+
227
+  gl.linkProgram(shader.program);
228
+
229
+  if (!gl.getProgramParameter(shader.program, gl.LINK_STATUS)) {
230
+    let lastError = gl.getProgramInfoLog(shader.program);
231
+
232
+    alert(`Could not initialise shaders: ${lastError}`);;
233
+    gl.deleteProgram(shader.program);
234
+    return null;
235
+  }
236
+
237
+  shader.positionLocation = gl.getAttribLocation(shader.program, 'v_pos');
238
+  shader.texCoordLocation = gl.getAttribLocation(shader.program, 'v_tex_coord');
239
+
240
+  shader.pMatrixLocation  = gl.getUniformLocation(shader.program, 'm_p');
241
+  shader.mvMatrixLocation = gl.getUniformLocation(shader.program, 'm_mv');
242
+
243
+  shader.textureLocation  = gl.getUniformLocation(shader.program, 'texture');
244
+
245
+  shader.resolutionLocation = gl.getUniformLocation(shader.program, 'res');
246
+  shader.uvMaxLocation = gl.getUniformLocation(shader.program, 'uv_max');
247
+  shader.warp2 = gl.getUniformLocation(shader.program, 'warp2');
248
+
249
+  return shader;
250
+}
251
+
252
+function setupGLState(gl) {
253
+  gl.clearColor(0.0, 0.0, 0.0, 0.0);
254
+  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
255
+  gl.enable(gl.BLEND);
256
+
257
+  // assuming that we'll be using pre-multiplied alpha
258
+  // see http://www.realtimerendering.com/blog/gpus-prefer-premultiplication/
259
+  gl.blendEquation(gl.FUNC_ADD);
260
+  gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
261
+
262
+//  gl.disable(gl.DEPTH_TEST);
263
+}
264
+
265
+function createRenderTexture(gl, config) {
266
+  // create to render to
267
+  const targetTextureWidth = config.render_texture_width;
268
+  const targetTextureHeight = config.render_texture_height;
269
+
270
+  const targetTexture = gl.createTexture();
271
+  gl.bindTexture(gl.TEXTURE_2D, targetTexture);
272
+
273
+  // define size and format of level 0
274
+  const level = 0;
275
+  const internalFormat = gl.RGBA;
276
+  const border = 0;
277
+  const format = gl.RGBA;
278
+  const type = gl.UNSIGNED_BYTE;
279
+  const data = null;
280
+  gl.texImage2D(gl.TEXTURE_2D, level, internalFormat,
281
+                targetTextureWidth, targetTextureHeight, border,
282
+                format, type, data);
283
+
284
+  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
285
+  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
286
+  // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
287
+  // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
288
+  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
289
+  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
290
+
291
+  return targetTexture;
292
+}
293
+
294
+function createFrameBuffer(gl, targetTexture) {
295
+  // Create and bind the framebuffer
296
+  const fb = gl.createFramebuffer();
297
+  gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
298
+
299
+  // attach the texture as the first color attachment
300
+  const attachmentPoint = gl.COLOR_ATTACHMENT0;
301
+  const level = 0;
302
+  gl.framebufferTexture2D(gl.FRAMEBUFFER, attachmentPoint, gl.TEXTURE_2D, targetTexture, level);
303
+
304
+  return fb;
305
+}
306
+
307
+function checkFramebufferStatus(gl) {
308
+  let res = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
309
+  switch(res) {
310
+  case gl.FRAMEBUFFER_COMPLETE: console.log("gl.FRAMEBUFFER_COMPLETE"); break;
311
+  case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: console.log("gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT"); break;
312
+  case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: console.log("gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"); break;
313
+  case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: console.log("gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS"); break;
314
+  case gl.FRAMEBUFFER_UNSUPPORTED: console.log("gl.FRAMEBUFFER_UNSUPPORTED"); break;
315
+  case gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: console.log("gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE"); break;
316
+  case gl.RENDERBUFFER_SAMPLES: console.log("gl.RENDERBUFFER_SAMPLE"); break;
317
+  }
318
+}
319
+
320
+class GLRenderer {
321
+  constructor(config, canvasElement) {
322
+    this.glDomElement = canvasElement;
323
+
324
+    // webgl setup
325
+    const gl = initGL(this.glDomElement);
326
+    this.gl = gl;
327
+
328
+    this.inGameShader = setupInGameShader(gl);
329
+    this.crtShader = setupCRTShader(gl);
330
+
331
+    setupGLState(gl);
332
+
333
+    this.glVertexBuffer = gl.createBuffer();
334
+    this.glColourBuffer = gl.createBuffer();
335
+    this.glTextureBuffer = gl.createBuffer();
336
+
337
+    this.mvMatrix = matrixCreate();
338
+    this.pMatrix = matrixCreate();
339
+    // Matrix.ortho(this.pMatrix, 0, config.canvas_width, 0, config.canvas_height, 10, -10);
340
+
341
+    this.tilesetTexture = this.gl.createTexture();
342
+    this.renderTexture = createRenderTexture(gl, config);
343
+    this.framebuffer = createFrameBuffer(gl, this.renderTexture);
344
+
345
+    // render to the canvas
346
+    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
347
+  }
348
+
349
+  loadTileset(src) {
350
+    let gl = this.gl;
351
+    let tex = this.tilesetTexture;
352
+
353
+    return new Promise(function(resolve, reject) {
354
+      const image = new Image();
3 355
 
4
-import { GLRenderer } from "./js/GLRenderer";
5
-import { Audio } from "./js/Audio";
6
-import { Metric } from "./js/Metric";
356
+      image.addEventListener('load', () => {
357
+        gl.bindTexture(gl.TEXTURE_2D, tex);
358
+        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
359
+        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
360
+        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
361
+        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
362
+
363
+        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
364
+        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
365
+
366
+        resolve([image.width, image.height]);
367
+      });
368
+
369
+      image.addEventListener('error', () => {
370
+        reject();
371
+      });
372
+
373
+      image.src = src;
374
+    });
375
+  }
376
+
377
+  renderGeometryToTexture(destTextureWidth, destTextureHeight, memoryF32, geo_len, geo_ptr) {
378
+    const gl = this.gl;
379
+
380
+    let shader = this.inGameShader;
381
+
382
+    // render to texture attached to framebuffer
383
+
384
+    gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer);
385
+    // gl.bindFramebuffer(gl.FRAMEBUFFER, null);
386
+
387
+    gl.bindTexture(gl.TEXTURE_2D, this.tilesetTexture);
388
+    gl.viewport(0, 0, destTextureWidth, destTextureHeight);
389
+
390
+    gl.useProgram(shader.program);
391
+
392
+    gl.enableVertexAttribArray(shader.positionLocation);
393
+    gl.enableVertexAttribArray(shader.colourLocation);
394
+    gl.enableVertexAttribArray(shader.texCoordLocation);
395
+
396
+    // gl.clearColor(0.0, 0.0, 1.0, 1.0);
397
+    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
398
+
399
+
400
+    // render the entirety of the scene
401
+    matrixOrtho(this.pMatrix, 0, destTextureWidth, 0, destTextureHeight, 10, -10);
402
+
403
+    gl.uniformMatrix4fv(shader.pMatrixLocation,
404
+                        false,
405
+                        this.pMatrix);
406
+
407
+    gl.uniformMatrix4fv(shader.mvMatrixLocation,
408
+                        false,
409
+                        this.mvMatrix);
410
+
411
+    gl.uniform1i(shader.textureLocation, 0);
412
+
413
+
414
+    const glVertexBuffer = this.glVertexBuffer;
415
+    const glColourBuffer = this.glColourBuffer;
416
+    const glTextureBuffer = this.glTextureBuffer;
417
+
418
+    const bytesin32bit = 4;
419
+
420
+    const vertexItemSize = 2;
421
+    const colourItemSize = 4;
422
+    const textureItemSize = 2;
423
+    const totalSize = (vertexItemSize + colourItemSize + textureItemSize);
424
+
425
+    const gbuf = memorySubArray(memoryF32, geo_ptr, geo_len);
426
+
427
+    gl.bindBuffer(gl.ARRAY_BUFFER, glVertexBuffer);
428
+    gl.bufferData(gl.ARRAY_BUFFER, gbuf, gl.STATIC_DRAW);
429
+    gl.vertexAttribPointer(shader.positionLocation,
430
+                           vertexItemSize,
431
+                           gl.FLOAT, false, totalSize * bytesin32bit,
432
+                           0 * bytesin32bit);
433
+
434
+    gl.bindBuffer(gl.ARRAY_BUFFER, glColourBuffer);
435
+    gl.bufferData(gl.ARRAY_BUFFER, gbuf, gl.STATIC_DRAW);
436
+    gl.vertexAttribPointer(shader.colourLocation,
437
+                           colourItemSize,
438
+                           gl.FLOAT, false, totalSize * bytesin32bit,
439
+                           vertexItemSize * bytesin32bit);
440
+
441
+    gl.bindBuffer(gl.ARRAY_BUFFER, glTextureBuffer);
442
+    gl.bufferData(gl.ARRAY_BUFFER, gbuf, gl.STATIC_DRAW);
443
+    gl.vertexAttribPointer(shader.texCoordLocation,
444
+                           textureItemSize,
445
+                           gl.FLOAT, false, totalSize * bytesin32bit,
446
+                           (vertexItemSize + colourItemSize) * bytesin32bit);
447
+
448
+    gl.drawArrays(gl.TRIANGLE_STRIP, 0, geo_len / totalSize);
449
+  }
450
+
451
+  renderTextureToScreen(canvasWidth, canvasHeight, memoryF32, geo_len, geo_ptr, curvature) {
452
+    const gl = this.gl;
453
+
454
+    let shader = this.crtShader;
455
+    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
456
+    gl.bindTexture(gl.TEXTURE_2D, this.renderTexture);
457
+    gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
458
+
459
+    gl.useProgram(shader.program);
460
+
461
+    gl.enableVertexAttribArray(shader.positionLocation);
462
+    gl.enableVertexAttribArray(shader.texCoordLocation);
463
+
464
+    // gl.clearColor(0.0, 0.0, 1.0, 1.0);
465
+    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
466
+
467
+    // render the entirety of the scene
468
+    matrixOrtho(this.pMatrix, 0, canvasWidth, 0, canvasHeight, 10, -10);
469
+
470
+    // add some uniforms for canvas width and height
471
+
472
+    gl.uniformMatrix4fv(shader.pMatrixLocation,
473
+                        false,
474
+                        this.pMatrix);
475
+
476
+    gl.uniformMatrix4fv(shader.mvMatrixLocation,
477
+                        false,
478
+                        this.mvMatrix);
479
+
480
+    gl.uniform1i(shader.textureLocation, 0);
481
+
482
+    gl.uniform2f(shader.resolutionLocation, canvasWidth, canvasHeight);
483
+    gl.uniform2f(shader.uvMaxLocation, 1.0, 1.0);
484
+    gl.uniform2f(shader.warp2, curvature, curvature);
485
+
486
+    // todo: why is it this.glVertexBuffer for both render to texture and render to screen?
487
+    const glVertexBuffer = this.glVertexBuffer;
488
+    const glTextureBuffer = this.glTextureBuffer;
489
+
490
+    const bytesin32bit = 4;
491
+
492
+    const vertexItemSize = 2;
493
+    const textureItemSize = 2;
494
+    const totalSize = (vertexItemSize + textureItemSize);
495
+
496
+    const gbuf = memorySubArray(memoryF32, geo_ptr, geo_len);
497
+
498
+    gl.bindBuffer(gl.ARRAY_BUFFER, glVertexBuffer);
499
+    gl.bufferData(gl.ARRAY_BUFFER, gbuf, gl.STATIC_DRAW);
500
+    gl.vertexAttribPointer(shader.positionLocation,
501
+                           vertexItemSize,
502
+                           gl.FLOAT, false, totalSize * bytesin32bit,
503
+                           0 * bytesin32bit);
504
+
505
+    gl.bindBuffer(gl.ARRAY_BUFFER, glTextureBuffer);
506
+    gl.bufferData(gl.ARRAY_BUFFER, gbuf, gl.STATIC_DRAW);
507
+    gl.vertexAttribPointer(shader.texCoordLocation,
508
+                           textureItemSize,
509
+                           gl.FLOAT, false, totalSize * bytesin32bit,
510
+                           (vertexItemSize) * bytesin32bit);
511
+
512
+    gl.drawArrays(gl.TRIANGLE_STRIP, 0, geo_len / totalSize);
513
+  }
514
+}
515
+
516
+// import { Howl, Howler } from "howler";
517
+
518
+class Audio {
519
+  constructor(config) {
520
+    this.loadedAudioTracks = false;
521
+  }
522
+
523
+  loadAudioTracks(bridge) {
524
+    this.track_info = {};
525
+
526
+    const num_audio_tracks = bridge.get_num_audio_tracks();
527
+
528
+    for (let i = 0; i < num_audio_tracks; i++) {
529
+      const audio_track_id = bridge.get_audio_track_id(i);
530
+      const audio_track_path = bridge.get_audio_track_path(i);
531
+
532
+      this.track_info[audio_track_id] = new Howl({
533
+        src: [audio_track_path]
534
+      });
535
+
536
+    }
537
+
538
+    this.loadedAudioTracks = true;
539
+  }
540
+
541
+  play(track_id) {
542
+    if (!this.loadedAudioTracks) {
543
+      console.error('Audio.js: Audio.play called before tracks have been loaded');
544
+      return;
545
+    }
546
+
547
+    const track = this.track_info[track_id];
548
+    if (track) {
549
+      track.play();
550
+    } else {
551
+      console.error(`unknown track_id: ${track_id}`);
552
+    }
553
+  }
554
+
555
+  volume(amount) {
556
+    // volume is in range 0..1
557
+    Howler.volume(amount);
558
+  }
559
+}
560
+
561
+class Metric {
562
+  constructor(maxSamples) {
563
+    this.maxSamples = maxSamples;
564
+    // the active counters
565
+    this.active = {};
566
+
567
+    this.measurement = {};
568
+  }
569
+
570
+  start(label) {
571
+    this.active[label] = performance.now();
572
+  }
573
+
574
+  stop(label) {
575
+    const start = this.active[label];
576
+    if (!start) {
577
+      console.error(`stop called on ${label} without a start`);
578
+      return;
579
+    }
580
+
581
+    const finish = performance.now();
582
+    const duration = finish - start;
583
+
584
+    this.add_measurement(label, duration);
585
+  }
586
+
587
+  add_measurement(label, duration) {
588
+    const measurement = this.measurement[label];
589
+    if (!measurement) {
590
+      this.measurement[label] = new Measurement(label, this.maxSamples);
591
+    }
592
+    this.measurement[label].add(duration);
593
+  }
594
+
595
+  report_all() {
596
+    let labels = Object.keys(this.measurement);
597
+    labels.forEach(label => this.measurement[label].report());
598
+    console.log("");
599
+  }
600
+}
601
+
602
+class Measurement {
603
+  constructor(label, maxSamples) {
604
+    this.label = label;
605
+    this.maxSamples = maxSamples;
606
+    this.samples = [];
607
+
608
+    this.all_sum = 0;
609
+    this.all_samples = 0;
610
+  }
611
+
612
+  add(duration) {
613
+
614
+    this.all_sum += duration;
615
+    this.all_samples++;
616
+
617
+    if (this.samples.length >= this.maxSamples) {
618
+      this.samples.shift();
619
+    }
620
+    this.samples.push(duration);
621
+  }
622
+
623
+  all_average() {
624
+    return this.all_sum / this.all_samples;
625
+  }
626
+
627
+  rolling_average() {
628
+    if (this.samples.length === 0) {
629
+      return 0;
630
+    }
631
+    const sum = this.samples.reduce((a, b) => a + b, 0);
632
+    return sum / this.samples.length;
633
+  }
634
+
635
+  report() {
636
+    console.log(`${this.label}: ${this.rolling_average()}ms (${this.samples.length})`);
637
+    // console.log(`${this.label}: ${this.rolling_average()} (${this.samples.length}) ${this.all_average()} (${this.all_samples})`);
638
+  }
639
+}
7 640
 
8 641
 let gState = {
9 642
   canvasId: 'render-canvas',
@@ -199,4 +832,14 @@ function main() {
199 832
   // gState.bridge.free();
200 833
 }
201 834
 
202
-main();
835
+document.addEventListener('DOMContentLoaded', () => {
836
+  wasm_bindgen('./sokoban_client_bg.wasm')
837
+    .then(() => {
838
+      // hack to access the memory
839
+      // the build.sh has a sed command to export the wasm object
840
+      // replace the js renderer with a rust implmentation to get rid of this hack
841
+      memory = wasm_bindgen.wasm.memory;
842
+      main();
843
+    })
844
+    .catch(console.error);
845
+});

+ 0
- 44
client/www/js/Audio.js View File

@@ -1,44 +0,0 @@
1
-import { Howl, Howler } from "howler";
2
-
3
-export class Audio {
4
-  constructor(config) {
5
-    this.loadedAudioTracks = false;
6
-  }
7
-
8
-  loadAudioTracks(bridge) {
9
-    this.track_info = {};
10
-
11
-    const num_audio_tracks = bridge.get_num_audio_tracks();
12
-
13
-    for (let i = 0; i < num_audio_tracks; i++) {
14
-      const audio_track_id = bridge.get_audio_track_id(i);
15
-      const audio_track_path = bridge.get_audio_track_path(i);
16
-
17
-      this.track_info[audio_track_id] = new Howl({
18
-        src: [audio_track_path]
19
-      });
20
-
21
-    }
22
-
23
-    this.loadedAudioTracks = true;
24
-  }
25
-
26
-  play(track_id) {
27
-    if (!this.loadedAudioTracks) {
28
-      console.error('Audio.js: Audio.play called before tracks have been loaded');
29
-      return;
30
-    }
31
-
32
-    const track = this.track_info[track_id];
33
-    if (track) {
34
-      track.play();
35
-    } else {
36
-      console.error(`unknown track_id: ${track_id}`);
37
-    }
38
-  }
39
-
40
-  volume(amount) {
41
-    // volume is in range 0..1
42
-    Howler.volume(amount);
43
-  }
44
-}

+ 0
- 466
client/www/js/GLRenderer.js View File

@@ -1,466 +0,0 @@
1
-import Matrix from './Matrix';
2
-
3
-const logToConsole = false;
4
-
5
-function memorySubArray(mem, ptr, length) {
6
-  const nByte = 4;
7
-  const pos = ptr / nByte;
8
-  return mem.subarray(pos, pos + length);
9
-}
10
-
11
-function initGL(canvas) {
12
-  try {
13
-    const gl = canvas.getContext('experimental-webgl', {
14
-      alpha: false,
15
-      preserveDrawingBuffer: true
16
-    });
17
-
18
-    if (!gl) {
19
-      alert('Could not initialise WebGL, sorry :-(');
20
-    }
21
-
22
-    return gl;
23
-  } catch (e) {
24
-    return undefined;
25
-  }
26
-}
27
-
28
-function compileShader(gl, type, src) {
29
-  const shader = gl.createShader(type);
30
-  gl.shaderSource(shader, src);
31
-  gl.compileShader(shader);
32
-
33
-  if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
34
-    let lastError = gl.getShaderInfoLog(shader);
35
-    console.log(`Error compiling shader ${shader} : ${lastError}`);
36
-    gl.deleteShader(shader);
37
-    return null;
38
-  }
39
-  return shader;
40
-}
41
-
42
-function setupInGameShader(gl) {
43
-  const shader = {};
44
-
45
-  shader.program = gl.createProgram();
46
-
47
-  const fragmentSrc = `
48
-  precision mediump float;
49
-  varying vec4 vColor;
50
-  varying highp vec2 vTextureCoord;
51
-
52
-  uniform sampler2D uSampler;
53
-
54
-  void main(void) {
55
-    vec4 tex = texture2D(uSampler, vTextureCoord);
56
-
57
-    gl_FragColor.r = tex.r * vColor.a * vColor.r;
58
-    gl_FragColor.g = tex.g * vColor.a * vColor.g;
59
-    gl_FragColor.b = tex.b * vColor.a * vColor.b;
60
-    gl_FragColor.a = tex.a * vColor.a;
61
-
62
-  }
63
-  `;
64
-
65
-  const vertexSrc = `
66
-  attribute vec2 aVertexPosition;
67
-  attribute vec4 aVertexColor;
68
-  attribute vec2 aVertexTexture;
69
-
70
-  uniform mat4 uMVMatrix;
71
-  uniform mat4 uPMatrix;
72
-
73
-  varying vec4 vColor;
74
-  varying highp vec2 vTextureCoord;
75
-
76
-  void main(void) {
77
-    gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 0.0, 1.0);
78
-    vColor = aVertexColor;
79
-    vTextureCoord = aVertexTexture;
80
-  }
81
-  `;
82
-
83
-  const vertexShader = compileShader(gl, gl.VERTEX_SHADER, vertexSrc);
84
-  const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSrc);
85
-
86
-  gl.attachShader(shader.program, vertexShader);
87
-  gl.attachShader(shader.program, fragmentShader);
88
-
89
-  gl.linkProgram(shader.program);
90
-
91
-  if (!gl.getProgramParameter(shader.program, gl.LINK_STATUS)) {
92
-    let lastError = gl.getProgramInfoLog(shader.program);
93
-
94
-    alert(`Could not initialise shaders: ${lastError}`);;
95
-    gl.deleteProgram(shader.program);
96
-    return null;
97
-  }
98
-
99
-  shader.positionLocation = gl.getAttribLocation(shader.program, 'aVertexPosition');
100
-  shader.colourLocation   = gl.getAttribLocation(shader.program, 'aVertexColor');
101
-  shader.texCoordLocation = gl.getAttribLocation(shader.program, 'aVertexTexture');
102
-
103
-  shader.pMatrixLocation  = gl.getUniformLocation(shader.program, 'uPMatrix');
104
-  shader.mvMatrixLocation = gl.getUniformLocation(shader.program, 'uMVMatrix');
105
-  shader.textureLocation  = gl.getUniformLocation(shader.program, 'uSampler');
106
-
107
-  return shader;
108
-}
109
-
110
-function setupCRTShader(gl) {
111
-  const shader = {};
112
-
113
-  shader.program = gl.createProgram();
114
-
115
-  const fragmentSrc = `
116
-  precision highp float;
117
-  varying vec2 tex_coord;
118
-
119
-  uniform sampler2D texture;
120
-  uniform vec2 res;
121
-  uniform vec2 uv_max;
122
-  uniform vec2 warp2;
123
-
124
-  // Amount of shadow mask.
125
-  float maskDark=0.7;
126
-  float maskLight=1.4;
127
-
128
-  // Distortion of scanlines, and end of screen alpha.
129
-  vec2 Warp(vec2 pos) {
130
-    pos = pos * 2.0 - 1.0;
131
-    pos *= vec2(1.0 + (pos.y * pos.y) * warp2.x, 1.0 + (pos.x * pos.x) * warp2.y);
132
-    return pos * 0.5 + 0.5;
133
-  }
134
-
135
-  // Shadow mask.
136
-  vec3 Mask(vec2 pos) {
137
-    pos.x += pos.y * 3.0;
138
-    vec3 mask = vec3(maskDark, maskDark, maskDark);
139
-    pos.x = fract(pos.x / 6.0);
140
-    if (pos.x < 0.333) mask.r = maskLight;
141
-    else if(pos.x < 0.666) mask.g=maskLight;
142
-    else mask.b = maskLight;
143
-    return mask;
144
-  }
145
-
146
-  void main(void) {
147
-    vec2 normalised_tex_coord = tex_coord / uv_max;
148
-    vec2 pos=Warp(normalised_tex_coord);
149
-    pos *= uv_max;
150
-    vec4 tex = texture2D(texture, pos);
151
-
152
-    vec2 pixel = res * pos;
153
-    gl_FragColor.rgb=tex.rgb;// * Mask(pixel.xy);
154
-    gl_FragColor.a = 1.0;
155
-  }
156
-  `;
157
-
158
-  const vertexSrc = `
159
-  attribute vec2 v_pos;
160
-  attribute vec2 v_tex_coord;
161
-
162
-  uniform mat4 m_mv;
163
-  uniform mat4 m_p;
164
-
165
-  varying highp vec2 tex_coord;
166
-
167
-  void main(void) {
168
-    gl_Position = m_p * m_mv * vec4(v_pos, 0.0, 1.0);
169
-    tex_coord = v_tex_coord;
170
-  }
171
-  `;
172
-
173
-  const vertexShader = compileShader(gl, gl.VERTEX_SHADER, vertexSrc);
174
-  const fragmentShader = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSrc);
175
-
176
-  gl.attachShader(shader.program, vertexShader);
177
-  gl.attachShader(shader.program, fragmentShader);
178
-
179
-  gl.linkProgram(shader.program);
180
-
181
-  if (!gl.getProgramParameter(shader.program, gl.LINK_STATUS)) {
182
-    let lastError = gl.getProgramInfoLog(shader.program);
183
-
184
-    alert(`Could not initialise shaders: ${lastError}`);;
185
-    gl.deleteProgram(shader.program);
186
-    return null;
187
-  }
188
-
189
-  shader.positionLocation = gl.getAttribLocation(shader.program, 'v_pos');
190
-  shader.texCoordLocation = gl.getAttribLocation(shader.program, 'v_tex_coord');
191
-
192
-  shader.pMatrixLocation  = gl.getUniformLocation(shader.program, 'm_p');
193
-  shader.mvMatrixLocation = gl.getUniformLocation(shader.program, 'm_mv');
194
-
195
-  shader.textureLocation  = gl.getUniformLocation(shader.program, 'texture');
196
-
197
-  shader.resolutionLocation = gl.getUniformLocation(shader.program, 'res');
198
-  shader.uvMaxLocation = gl.getUniformLocation(shader.program, 'uv_max');
199
-  shader.warp2 = gl.getUniformLocation(shader.program, 'warp2');
200
-
201
-  return shader;
202
-}
203
-
204
-function setupGLState(gl) {
205
-  gl.clearColor(0.0, 0.0, 0.0, 0.0);
206
-  gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
207
-  gl.enable(gl.BLEND);
208
-
209
-  // assuming that we'll be using pre-multiplied alpha
210
-  // see http://www.realtimerendering.com/blog/gpus-prefer-premultiplication/
211
-  gl.blendEquation(gl.FUNC_ADD);
212
-  gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
213
-
214
-//  gl.disable(gl.DEPTH_TEST);
215
-}
216
-
217
-function createRenderTexture(gl, config) {
218
-  // create to render to
219
-  const targetTextureWidth = config.render_texture_width;
220
-  const targetTextureHeight = config.render_texture_height;
221
-
222
-  const targetTexture = gl.createTexture();
223
-  gl.bindTexture(gl.TEXTURE_2D, targetTexture);
224
-
225
-  // define size and format of level 0
226
-  const level = 0;
227
-  const internalFormat = gl.RGBA;
228
-  const border = 0;
229
-  const format = gl.RGBA;
230
-  const type = gl.UNSIGNED_BYTE;
231
-  const data = null;
232
-  gl.texImage2D(gl.TEXTURE_2D, level, internalFormat,
233
-                targetTextureWidth, targetTextureHeight, border,
234
-                format, type, data);
235
-
236
-  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
237
-  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
238
-  // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
239
-  // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
240
-  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
241
-  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
242
-
243
-  return targetTexture;
244
-}
245
-
246
-function createFrameBuffer(gl, targetTexture) {
247
-  // Create and bind the framebuffer
248
-  const fb = gl.createFramebuffer();
249
-  gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
250
-
251
-  // attach the texture as the first color attachment
252
-  const attachmentPoint = gl.COLOR_ATTACHMENT0;
253
-  const level = 0;
254
-  gl.framebufferTexture2D(gl.FRAMEBUFFER, attachmentPoint, gl.TEXTURE_2D, targetTexture, level);
255
-
256
-  return fb;
257
-}
258
-
259
-function checkFramebufferStatus(gl) {
260
-  let res = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
261
-  switch(res) {
262
-  case gl.FRAMEBUFFER_COMPLETE: console.log("gl.FRAMEBUFFER_COMPLETE"); break;
263
-  case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: console.log("gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT"); break;
264
-  case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: console.log("gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"); break;
265
-  case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: console.log("gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS"); break;
266
-  case gl.FRAMEBUFFER_UNSUPPORTED: console.log("gl.FRAMEBUFFER_UNSUPPORTED"); break;
267
-  case gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: console.log("gl.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE"); break;
268
-  case gl.RENDERBUFFER_SAMPLES: console.log("gl.RENDERBUFFER_SAMPLE"); break;
269
-  }
270
-}
271
-
272
-export class GLRenderer {
273
-  constructor(config, canvasElement) {
274
-    this.glDomElement = canvasElement;
275
-
276
-    // webgl setup
277
-    const gl = initGL(this.glDomElement);
278
-    this.gl = gl;
279
-
280
-    this.inGameShader = setupInGameShader(gl);
281
-    this.crtShader = setupCRTShader(gl);
282
-
283
-    setupGLState(gl);
284
-
285
-    this.glVertexBuffer = gl.createBuffer();
286
-    this.glColourBuffer = gl.createBuffer();
287
-    this.glTextureBuffer = gl.createBuffer();
288
-
289
-    this.mvMatrix = Matrix.create();
290
-    this.pMatrix = Matrix.create();
291
-    // Matrix.ortho(this.pMatrix, 0, config.canvas_width, 0, config.canvas_height, 10, -10);
292
-
293
-    this.tilesetTexture = this.gl.createTexture();
294
-    this.renderTexture = createRenderTexture(gl, config);
295
-    this.framebuffer = createFrameBuffer(gl, this.renderTexture);
296
-
297
-    // render to the canvas
298
-    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
299
-  }
300
-
301
-  loadTileset(src) {
302
-    let gl = this.gl;
303
-    let tex = this.tilesetTexture;
304
-
305
-    return new Promise(function(resolve, reject) {
306
-      const image = new Image();
307
-
308
-      image.addEventListener('load', () => {
309
-        gl.bindTexture(gl.TEXTURE_2D, tex);
310
-        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
311
-        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
312
-        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
313
-        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
314
-
315
-        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
316
-        gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
317
-
318
-        resolve([image.width, image.height]);
319
-      });
320
-
321
-      image.addEventListener('error', () => {
322
-        reject();
323
-      });
324
-
325
-      image.src = src;
326
-    });
327
-  }
328
-
329
-  renderGeometryToTexture(destTextureWidth, destTextureHeight, memoryF32, geo_len, geo_ptr) {
330
-    const gl = this.gl;
331
-
332
-    let shader = this.inGameShader;
333
-
334
-    // render to texture attached to framebuffer
335
-
336
-    gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer);
337
-    // gl.bindFramebuffer(gl.FRAMEBUFFER, null);
338
-
339
-    gl.bindTexture(gl.TEXTURE_2D, this.tilesetTexture);
340
-    gl.viewport(0, 0, destTextureWidth, destTextureHeight);
341
-
342
-    gl.useProgram(shader.program);
343
-
344
-    gl.enableVertexAttribArray(shader.positionLocation);
345
-    gl.enableVertexAttribArray(shader.colourLocation);
346
-    gl.enableVertexAttribArray(shader.texCoordLocation);
347
-
348
-    // gl.clearColor(0.0, 0.0, 1.0, 1.0);
349
-    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
350
-
351
-
352
-    // render the entirety of the scene
353
-    Matrix.ortho(this.pMatrix, 0, destTextureWidth, 0, destTextureHeight, 10, -10);
354
-
355
-    gl.uniformMatrix4fv(shader.pMatrixLocation,
356
-                        false,
357
-                        this.pMatrix);
358
-
359
-    gl.uniformMatrix4fv(shader.mvMatrixLocation,
360
-                        false,
361
-                        this.mvMatrix);
362
-
363
-    gl.uniform1i(shader.textureLocation, 0);
364
-
365
-
366
-    const glVertexBuffer = this.glVertexBuffer;
367
-    const glColourBuffer = this.glColourBuffer;
368
-    const glTextureBuffer = this.glTextureBuffer;
369
-
370
-    const bytesin32bit = 4;
371
-
372
-    const vertexItemSize = 2;
373
-    const colourItemSize = 4;
374
-    const textureItemSize = 2;
375
-    const totalSize = (vertexItemSize + colourItemSize + textureItemSize);
376
-
377
-    const gbuf = memorySubArray(memoryF32, geo_ptr, geo_len);
378
-
379
-    gl.bindBuffer(gl.ARRAY_BUFFER, glVertexBuffer);
380
-    gl.bufferData(gl.ARRAY_BUFFER, gbuf, gl.STATIC_DRAW);
381
-    gl.vertexAttribPointer(shader.positionLocation,
382
-                           vertexItemSize,
383
-                           gl.FLOAT, false, totalSize * bytesin32bit,
384
-                           0 * bytesin32bit);
385
-
386
-    gl.bindBuffer(gl.ARRAY_BUFFER, glColourBuffer);
387
-    gl.bufferData(gl.ARRAY_BUFFER, gbuf, gl.STATIC_DRAW);
388
-    gl.vertexAttribPointer(shader.colourLocation,
389
-                           colourItemSize,
390
-                           gl.FLOAT, false, totalSize * bytesin32bit,
391
-                           vertexItemSize * bytesin32bit);
392
-
393
-    gl.bindBuffer(gl.ARRAY_BUFFER, glTextureBuffer);
394
-    gl.bufferData(gl.ARRAY_BUFFER, gbuf, gl.STATIC_DRAW);
395
-    gl.vertexAttribPointer(shader.texCoordLocation,
396
-                           textureItemSize,
397
-                           gl.FLOAT, false, totalSize * bytesin32bit,
398
-                           (vertexItemSize + colourItemSize) * bytesin32bit);
399
-
400
-    gl.drawArrays(gl.TRIANGLE_STRIP, 0, geo_len / totalSize);
401
-  }
402
-
403
-  renderTextureToScreen(canvasWidth, canvasHeight, memoryF32, geo_len, geo_ptr, curvature) {
404
-    const gl = this.gl;
405
-
406
-    let shader = this.crtShader;
407
-    gl.bindFramebuffer(gl.FRAMEBUFFER, null);
408
-    gl.bindTexture(gl.TEXTURE_2D, this.renderTexture);
409
-    gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
410
-
411
-    gl.useProgram(shader.program);
412
-
413
-    gl.enableVertexAttribArray(shader.positionLocation);
414
-    gl.enableVertexAttribArray(shader.texCoordLocation);
415
-
416
-    // gl.clearColor(0.0, 0.0, 1.0, 1.0);
417
-    gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
418
-
419
-    // render the entirety of the scene
420
-    Matrix.ortho(this.pMatrix, 0, canvasWidth, 0, canvasHeight, 10, -10);
421
-
422
-    // add some uniforms for canvas width and height
423
-
424
-    gl.uniformMatrix4fv(shader.pMatrixLocation,
425
-                        false,
426
-                        this.pMatrix);
427
-
428
-    gl.uniformMatrix4fv(shader.mvMatrixLocation,
429
-                        false,
430
-                        this.mvMatrix);
431
-
432
-    gl.uniform1i(shader.textureLocation, 0);
433
-
434
-    gl.uniform2f(shader.resolutionLocation, canvasWidth, canvasHeight);
435
-    gl.uniform2f(shader.uvMaxLocation, 1.0, 1.0);
436
-    gl.uniform2f(shader.warp2, curvature, curvature);
437
-
438
-    // todo: why is it this.glVertexBuffer for both render to texture and render to screen?
439
-    const glVertexBuffer = this.glVertexBuffer;
440
-    const glTextureBuffer = this.glTextureBuffer;
441
-
442
-    const bytesin32bit = 4;
443
-
444
-    const vertexItemSize = 2;
445
-    const textureItemSize = 2;
446
-    const totalSize = (vertexItemSize + textureItemSize);
447
-
448
-    const gbuf = memorySubArray(memoryF32, geo_ptr, geo_len);
449
-
450
-    gl.bindBuffer(gl.ARRAY_BUFFER, glVertexBuffer);
451
-    gl.bufferData(gl.ARRAY_BUFFER, gbuf, gl.STATIC_DRAW);
452
-    gl.vertexAttribPointer(shader.positionLocation,
453
-                           vertexItemSize,
454
-                           gl.FLOAT, false, totalSize * bytesin32bit,
455
-                           0 * bytesin32bit);
456
-
457
-    gl.bindBuffer(gl.ARRAY_BUFFER, glTextureBuffer);
458
-    gl.bufferData(gl.ARRAY_BUFFER, gbuf, gl.STATIC_DRAW);
459
-    gl.vertexAttribPointer(shader.texCoordLocation,
460
-                           textureItemSize,
461
-                           gl.FLOAT, false, totalSize * bytesin32bit,
462
-                           (vertexItemSize) * bytesin32bit);
463
-
464
-    gl.drawArrays(gl.TRIANGLE_STRIP, 0, geo_len / totalSize);
465
-  }
466
-}

+ 0
- 259
client/www/js/Matrix.js View File

@@ -1,259 +0,0 @@
1
-/**
2
- * Code taken from gl-matrix (http://glmatrix.net/)
3
-
4
-Copyright (c) 2015, Brandon Jones, Colin MacKenzie IV.
5
-
6
-Permission is hereby granted, free of charge, to any person obtaining a copy
7
-of this software and associated documentation files (the "Software"), to deal
8
-in the Software without restriction, including without limitation the rights
9
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
-copies of the Software, and to permit persons to whom the Software is
11
-furnished to do so, subject to the following conditions:
12
-
13
-The above copyright notice and this permission notice shall be included in
14
-all copies or substantial portions of the Software.
15
-
16
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
-THE SOFTWARE.
23
-**/
24
-
25
-function create() {
26
-  const out = new Float32Array(16);
27
-  out[0] = 1;
28
-  out[1] = 0;
29
-  out[2] = 0;
30
-  out[3] = 0;
31
-  out[4] = 0;
32
-  out[5] = 1;
33
-  out[6] = 0;
34
-  out[7] = 0;
35
-  out[8] = 0;
36
-  out[9] = 0;
37
-  out[10] = 1;
38
-  out[11] = 0;
39
-  out[12] = 0;
40
-  out[13] = 0;
41
-  out[14] = 0;
42
-  out[15] = 1;
43
-
44
-  return out;
45
-}
46
-
47
-function identity(out) {
48
-  out[0] = 1;
49
-  out[1] = 0;
50
-  out[2] = 0;
51
-  out[3] = 0;
52
-  out[4] = 0;
53
-  out[5] = 1;
54
-  out[6] = 0;
55
-  out[7] = 0;
56
-  out[8] = 0;
57
-  out[9] = 0;
58
-  out[10] = 1;
59
-  out[11] = 0;
60
-  out[12] = 0;
61
-  out[13] = 0;
62
-  out[14] = 0;
63
-  out[15] = 1;
64
-
65
-  return out;
66
-}
67
-
68
-function ortho(out, left, right, bottom, top, near, far) {
69
-  const lr = 1 / (left - right);
70
-  const bt = 1 / (bottom - top);
71
-  const nf = 1 / (near - far);
72
-
73
-  out[0] = -2 * lr;
74
-  out[1] = 0;
75
-  out[2] = 0;
76
-  out[3] = 0;
77
-  out[4] = 0;
78
-  out[5] = -2 * bt;
79
-  out[6] = 0;
80
-  out[7] = 0;
81
-  out[8] = 0;
82
-  out[9] = 0;
83
-  out[10] = 2 * nf;
84
-  out[11] = 0;
85
-  out[12] = (left + right) * lr;
86
-  out[13] = (top + bottom) * bt;
87
-  out[14] = (far + near) * nf;
88
-  out[15] = 1;
89
-
90
-  return out;
91
-}
92
-
93
-function clone(a) {
94
-  const out = new Float32Array(16);
95
-  out[0] = a[0];
96
-  out[1] = a[1];
97
-  out[2] = a[2];
98
-  out[3] = a[3];
99
-  out[4] = a[4];
100
-  out[5] = a[5];
101
-  out[6] = a[6];
102
-  out[7] = a[7];
103
-  out[8] = a[8];
104
-  out[9] = a[9];
105
-  out[10] = a[10];
106
-  out[11] = a[11];
107
-  out[12] = a[12];
108
-  out[13] = a[13];
109
-  out[14] = a[14];
110
-  out[15] = a[15];
111
-
112
-  return out;
113
-}
114
-
115
-function scale(out, a, v) {
116
-  const x = v[0], y = v[1], z = v[2];
117
-
118
-  out[0] = a[0] * x;
119
-  out[1] = a[1] * x;
120
-  out[2] = a[2] * x;
121
-  out[3] = a[3] * x;
122
-  out[4] = a[4] * y;
123
-  out[5] = a[5] * y;
124
-  out[6] = a[6] * y;
125
-  out[7] = a[7] * y;
126
-  out[8] = a[8] * z;
127
-  out[9] = a[9] * z;
128
-  out[10] = a[10] * z;
129
-  out[11] = a[11] * z;
130
-  out[12] = a[12];
131
-  out[13] = a[13];
132
-  out[14] = a[14];
133
-  out[15] = a[15];
134
-
135
-  return out;
136
-}
137
-
138
-function multiply(out, a, b) {
139
-  const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];
140
-  const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];
141
-  const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
142
-  const a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15];
143
-
144
-  // Cache only the current line of the second matrix
145
-  const b0  = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
146
-  out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
147
-  out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
148
-  out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
149
-  out[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
150
-
151
-  b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7];
152
-  out[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
153
-  out[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
154
-  out[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
155
-  out[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
156
-
157
-  b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11];
158
-  out[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
159
-  out[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
160
-  out[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
161
-  out[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
162
-
163
-  b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15];
164
-  out[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
165
-  out[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
166
-  out[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
167
-  out[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
168
-
169
-  return out;
170
-}
171
-
172
-function translate(out, a, v) {
173
-  const x = v[0], y = v[1], z = v[2];
174
-  // let a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23;
175
-
176
-  if (a === out) {
177
-    out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];
178
-    out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];
179
-    out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];
180
-    out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];
181
-  } else {
182
-    const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];
183
-    const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];
184
-    const a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11];
185
-
186
-    out[0] = a00; out[1] = a01; out[2] = a02; out[3] = a03;
187
-    out[4] = a10; out[5] = a11; out[6] = a12; out[7] = a13;
188
-    out[8] = a20; out[9] = a21; out[10] = a22; out[11] = a23;
189
-
190
-    out[12] = a00 * x + a10 * y + a20 * z + a[12];
191
-    out[13] = a01 * x + a11 * y + a21 * z + a[13];
192
-    out[14] = a02 * x + a12 * y + a22 * z + a[14];
193
-    out[15] = a03 * x + a13 * y + a23 * z + a[15];
194
-  }
195
-
196
-  return out;
197
-}
198
-
199
-function rotateZ(out, a, rad) {
200
-  const s = Math.sin(rad), c = Math.cos(rad);
201
-  const a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3];
202
-  const a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7];
203
-
204
-  if (a !== out) {
205
-    out[8] = a[8];
206
-    out[9] = a[9];
207
-    out[10] = a[10];
208
-    out[11] = a[11];
209
-    out[12] = a[12];
210
-    out[13] = a[13];
211
-    out[14] = a[14];
212
-    out[15] = a[15];
213
-  }
214
-
215
-  // Perform axis-specific matrix multiplication
216
-  out[0] = a00 * c + a10 * s;
217
-  out[1] = a01 * c + a11 * s;
218
-  out[2] = a02 * c + a12 * s;
219
-  out[3] = a03 * c + a13 * s;
220
-  out[4] = a10 * c - a00 * s;
221
-  out[5] = a11 * c - a01 * s;
222
-  out[6] = a12 * c - a02 * s;
223
-  out[7] = a13 * c - a03 * s;
224
-
225
-  return out;
226
-}
227
-
228
-function transformVec2(out, a, m) {
229
-  const x = a[0];
230
-  const y = a[1];
231
-  out[0] = m[0] * x + m[4] * y + m[12];
232
-  out[1] = m[1] * x + m[5] * y + m[13];
233
-
234
-  return out;
235
-}
236
-
237
-function transformVec3(out, a, m) {
238
-  const x = a[0], y = a[1], z = a[2];
239
-  let w = m[3] * x + m[7] * y + m[11] * z + m[15];
240
-  w = w || 1.0;
241
-  out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;
242
-  out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;
243
-  out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;
244
-
245
-  return out;
246
-}
247
-
248
-export default {
249
-  create,
250
-  identity,
251
-  ortho,
252
-  clone,
253
-  scale,
254
-  multiply,
255
-  translate,
256
-  rotateZ,
257
-  transformVec2,
258
-  transformVec3
259
-};

+ 0
- 81
client/www/js/Metric.js View File

@@ -1,81 +0,0 @@
1
-
2
-
3
-export class Metric {
4
-  constructor(maxSamples) {
5
-    this.maxSamples = maxSamples;
6
-    // the active counters
7
-    this.active = {};
8
-
9
-    this.measurement = {};
10
-  }
11
-
12
-  start(label) {
13
-    this.active[label] = performance.now();
14
-  }
15
-
16
-  stop(label) {
17
-    const start = this.active[label];
18
-    if (!start) {
19
-      console.error(`stop called on ${label} without a start`);
20
-      return;
21
-    }
22
-
23
-    const finish = performance.now();
24
-    const duration = finish - start;
25
-
26
-    this.add_measurement(label, duration);
27
-  }
28
-
29
-  add_measurement(label, duration) {
30
-    const measurement = this.measurement[label];
31
-    if (!measurement) {
32
-      this.measurement[label] = new Measurement(label, this.maxSamples);
33
-    }
34
-    this.measurement[label].add(duration);
35
-  }
36
-
37
-  report_all() {
38
-    let labels = Object.keys(this.measurement);
39
-    labels.forEach(label => this.measurement[label].report());
40
-    console.log("");
41
-  }
42
-}
43
-
44
-class Measurement {
45
-  constructor(label, maxSamples) {
46
-    this.label = label;
47
-    this.maxSamples = maxSamples;
48
-    this.samples = [];
49
-
50
-    this.all_sum = 0;
51
-    this.all_samples = 0;
52
-  }
53
-
54
-  add(duration) {
55
-
56
-    this.all_sum += duration;
57
-    this.all_samples++;
58
-
59
-    if (this.samples.length >= this.maxSamples) {
60
-      this.samples.shift();
61
-    }
62
-    this.samples.push(duration);
63
-  }
64
-
65
-  all_average() {
66
-    return this.all_sum / this.all_samples;
67
-  }
68
-
69
-  rolling_average() {
70
-    if (this.samples.length === 0) {
71
-      return 0;
72
-    }
73
-    const sum = this.samples.reduce((a, b) => a + b, 0);
74
-    return sum / this.samples.length;
75
-  }
76
-
77
-  report() {
78
-    console.log(`${this.label}: ${this.rolling_average()}ms (${this.samples.length})`);
79
-    // console.log(`${this.label}: ${this.rolling_average()} (${this.samples.length}) ${this.all_average()} (${this.all_samples})`);
80
-  }
81
-}

+ 0
- 5393
client/www/package-lock.json
File diff suppressed because it is too large
View File


+ 0
- 27
client/www/package.json View File

@@ -1,27 +0,0 @@
1
-{
2
-  "name": "sokoban-client-www",
3
-  "version": "0.1.0",
4
-  "description": "",
5
-  "main": "index.js",
6
-  "scripts": {
7
-    "build": "webpack --config webpack.config.js",
8
-    "start": "webpack-dev-server"
9
-  },
10
-  "keywords": [
11
-    "webassembly",
12
-    "wasm",
13
-    "rust",
14
-    "webpack"
15
-  ],
16
-  "author": "Inderjit Gill <email@indy.io>",
17
-  "license": "(MIT OR Apache-2.0)",
18
-  "devDependencies": {
19
-    "webpack": "^4.16.3",
20
-    "webpack-cli": "^3.1.0",
21
-    "webpack-dev-server": "^3.1.5",
22
-    "copy-webpack-plugin": "^4.5.2"
23
-  },
24
-  "dependencies": {
25
-    "howler": "2.0.14"
26
-  }
27
-}

+ 0
- 2
client/www/wasm/.gitignore View File

@@ -1,2 +0,0 @@
1
-*
2
-!.gitignore

+ 0
- 14
client/www/webpack.config.js View File

@@ -1,14 +0,0 @@
1
-const CopyWebpackPlugin = require("copy-webpack-plugin");
2
-const path = require('path');
3
-
4
-module.exports = {
5
-  entry: "./bootstrap.js",
6
-  output: {
7
-    path: path.resolve(__dirname, "dist"),
8
-    filename: "bootstrap.js",
9
-  },
10
-  mode: "development",
11
-  plugins: [
12
-    new CopyWebpackPlugin(['index.html'])
13
-  ],
14
-};

Loading…
Cancel
Save