Make emscripten --preload-file opt-in

This commit is contained in:
Zack Middleton committed 2024-06-11 04:40:08 -04:00
1 parent ab8f7eb0bd
commit 41ec9ae05f
2 files changed
+12 -19

No files matched your search

+8 -5
View File
@@ -102,13 +102,12 @@ For macOS, building a Universal Binary 2 (macOS 10.9+, arm64, x86_64)
For Web, building with Emscripten
1. Follow the installation instructions for the Emscripten SDK including
setting up the environment with emsdk_env.
2. Copy or symlink your baseq3 directory into this directory so Emscripten
can package your game files. (Alternatively, you can build without this,
and provide the game data files at runtime. For this, game files should
be listed in `ioq3-config.json`)
3. Run `emmake make debug` (or release, but if you do both then you will
2. Run `emmake make debug` (or release, but if you do both then you will
need to pass an extra URL parameter to the HTML file to select the
build you want).
3. Copy or symlink your baseq3 pk3 files into the `build/debug-emscripten-wasm32/baseq3`
directory so they can be loaded at run-time. Only game files listed in
`ioq3-config.json` will be loaded.
4. Start a web server serving this directory. `python3 -m http.server`
is an easy default that you may already have installed.
5. Open `code/web/ioquake3.html` in a web browser. Open the developer
@@ -177,6 +176,10 @@ Makefile.local:
DEBUG_CFLAGS - C compiler flags to use for building debug version
COPYDIR - the target installation directory
TEMPDIR - specify user defined directory for temp files
EMSCRIPTEN_PRELOAD_FILE - set to 1 to package 'baseq3' (BASEGAME) directory
containing pk3s and loose files as a single
.data file that is loaded instead of listing
individual files in ioq3-config.json
```
The defaults for these variables differ depending on the target platform.