mrpci_request_save / mrpci_save_out / mrpci_save_in carry a SaveData across the wasm boundary, so the browser build can save and restore even though Command::SaveGame's std::fs call goes nowhere there. The moment being stored is exactly the one the native build writes to saves/<slot>.json — the same GameState::save_data — so a slot means the same thing in both places. F5 now asks the page instead of the filesystem; F7 points at the SAVES menu, because restoring needs to know *which* slot and a function key can't say. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
19 lines
865 B
TOML
19 lines
865 B
TOML
# Which game gets baked into wasm builds (WEB_BUNDLE in mrpci/src/main.rs).
|
|
# It is a WorldBundle JSON, not a folder: the browser has no filesystem, and
|
|
# `mrpci-headless --export-bundle` already writes exactly this document.
|
|
# web/build.sh regenerates it and overrides the path per build.
|
|
[env]
|
|
MRPCI_WEB_BUNDLE = { value = "web/game.bundle.json", 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 mrpci_* exports are the page's game-loading bridge into the engine.
|
|
[target.wasm32-unknown-unknown]
|
|
rustflags = [
|
|
"-C", "link-arg=--allow-undefined",
|
|
"-C", "link-arg=--export=mrpci_alloc",
|
|
"-C", "link-arg=--export=mrpci_world_in",
|
|
"-C", "link-arg=--export=mrpci_save_in",
|
|
"-C", "link-arg=--export=mrpci_request_save",
|
|
]
|