summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HOWTO.md27
1 files changed, 19 insertions, 8 deletions
diff --git a/HOWTO.md b/HOWTO.md
index 605fdff..8efbf59 100644
--- a/HOWTO.md
+++ b/HOWTO.md
@@ -129,24 +129,35 @@ This system allows embedding binary assets directly into the demo executable.
#### Defining Assets
-Assets are defined in `assets/final/assets.txt`. Each line specifies:
-* `ASSET_NAME`: The identifier for the asset in C++ (e.g., `SAMPLE_142`).
+Assets are defined in `assets/final/demo_assets.txt` (for the demo) and `assets/final/test_assets_list.txt` (for tests). Each line specifies:
+* `ASSET_NAME`: The identifier for the asset in C++ (e.g., `KICK_1`).
* `filename.ext`: The path to the asset file (relative to `assets/final/`).
* `NONE`: Compression type (currently only `NONE` is supported).
* `"Description"`: An optional description.
-Example `assets/final/assets.txt` entry:
+Example `assets/final/demo_assets.txt` entry:
```
-SAMPLE_142, sample_142.spec, NONE, "A drum kick sample"
+KICK_1, kick1.spec, NONE, "A drum kick sample"
```
+#### Re-generating Assets
+
+To re-analyze source audio files (WAV/MP3) into spectrograms and update the embedded assets in the source tree, use the provided script:
+
+```bash
+./scripts/gen_assets.sh
+```
+
+This script:
+1. Ensures `spectool` and `asset_packer` are built.
+2. Converts source audio files in `assets/wav/` to `.spec` files in `assets/final/`.
+3. Runs `asset_packer` to update `src/assets.h` and `src/assets_data.cc`.
+
#### Building with Assets
-The `asset_packer` tool processes `assets/final/assets.txt` and generates two files:
-* `build/src/assets.h`: Contains the `AssetId` enum and `GetAsset` function declaration.
-* `build/src/assets_data.cc`: Contains the binary data for each asset.
+The build system automatically runs `asset_packer` whenever the asset lists are modified. The generated files are located in the build directory (`build/src/`).
-These files are automatically generated as part of the normal build process when `demo64k` is built. To trigger generation, simply run:
+To build the demo with the latest assets:
```bash
cmake -S . -B build