a game about throwing hammers made for the github game off
Diffstat (limited to 'html/custom.html')
| -rw-r--r-- | html/custom.html | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/html/custom.html b/html/custom.html index 832478b..6105593 100644 --- a/html/custom.html +++ b/html/custom.html @@ -46,6 +46,7 @@ bottom: 0; display: flex; justify-content: center; + border-radius: 5px; align-items: center; /* don't consume click events - make children visible explicitly */ visibility: hidden; @@ -246,9 +247,32 @@ setStatusMode("notice"); initializing = false; } + function has_wasm() { + if (typeof WebAssembly !== "object") return false; + const source = Uint8Array.from([ + 0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 7, + 8, 1, 4, 116, 101, 115, 116, 0, 0, 10, 15, 1, 13, 0, 65, 0, 253, 17, + 65, 0, 253, 17, 253, 186, 1, 11, + ]); + if ( + typeof WebAssembly.validate !== "function" || + !WebAssembly.validate(source) + ) + return false; + if (typeof Atomics !== "object") return false; + if (typeof SharedArrayBuffer !== "function") return false; + return true; + } + if (!has_wasm()) { + displayFailureNotice( + "SharedArrayBuffer(for multithreading) not available. Please try a different browser." + ); + } if (!Engine.isWebGLAvailable()) { - displayFailureNotice("WebGL not available"); + displayFailureNotice( + "WebGL not available. Please try a different browser." + ); } else { setStatusMode("indeterminate"); engine |