Skip to content
Discussion options

You must be logged in to vote

See wasm-bindgen/wasm-bindgen#3818 (comment)

  private async initializeGameCanvas() {
    // wasm is bundled into tiddlywiki using `game/tiddlywiki.files` as base64
    const gameWasm = $tw.wiki.getTiddlerText('$:/plugins/linonetwo/scp-foundation-site-director/game_bg.wasm');
    // we parse and run the code on runtime, to create a new JS context each time, to prevent reuse last game's wasm.
    const wasmBindGenJSCode = $tw.wiki.getTiddlerText('$:/plugins/linonetwo/scp-foundation-site-director/game.js');

    if (gameWasm !== undefined && wasmBindGenJSCode !== undefined) {
      const wasmBuffer = loadWasmModuleFromBase64(gameWasm);
      console.time('gameLoad'); // 384 ~ 1551 ms
      try

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@linonetwo
Comment options

Comment options

You must be logged in to vote
1 reply
@daxpedda
Comment options

Comment options

You must be logged in to vote
1 reply
@daxpedda
Comment options

Answer selected by linonetwo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants