MRPGI/.cargo/config.toml
type-two 23865f1483 Web: bake any game into the wasm; never block first paint on audio
- MRPGI_WEB_GAME env (default games/lost-fuse via .cargo/config.toml)
  selects the game include_dir! embeds; web/build.sh <game-dir> stages
  just game.json+rooms+sprites (a repo's raw art was ballooning the wasm
  to 41MB; now 1.9MB) and ships the game's web/index.html and music/.
- sound.rs: file overrides load through macroquad's loader (fs on native,
  HTTP fetch on web), and AudioOut now loads inside a coroutine behind
  LazyAudio — browsers gate audio decoding behind a user gesture, and
  blocking boot on it was a black screen. First frame draws immediately;
  music starts when ready, remembering the requested mood/mute.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 15:53:22 +10:00

17 lines
724 B
TOML

# Which game folder gets baked into wasm builds (embedded_world in main.rs).
# Override per build: MRPGI_WEB_GAME=/abs/path ./web/build.sh <dir> does it.
[env]
MRPGI_WEB_GAME = { value = "games/lost-fuse", relative = true }
# Web builds: miniquad's JS imports (console_log, init_webgl, ...) are
# resolved at runtime by web/mq_js_bundle.js — tell the linker to allow them.
# The mrpgi_* exports are the page's save/load bridge into the engine.
[target.wasm32-unknown-unknown]
rustflags = [
"-C", "link-arg=--allow-undefined",
"-C", "link-arg=--export=mrpgi_alloc",
"-C", "link-arg=--export=mrpgi_world_in",
"-C", "link-arg=--export=mrpgi_request_save",
"-C", "link-arg=--export=mrpgi_save_pending",
]