diff options
Diffstat (limited to 'doc/ASSET_SYSTEM.md')
| -rw-r--r-- | doc/ASSET_SYSTEM.md | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/doc/ASSET_SYSTEM.md b/doc/ASSET_SYSTEM.md index 4e34378..f52e382 100644 --- a/doc/ASSET_SYSTEM.md +++ b/doc/ASSET_SYSTEM.md @@ -17,11 +17,11 @@ DropAsset(ASSET_SAMPLE_142, mysample); // For lazy decompression cleanup ## Asset Manifest Format -File: `assets/final/demo_assets.txt` +Files: `workspaces/main/assets.txt`, `workspaces/test/assets.txt` Format (CSV): ``` -ASSET_NAME, filename.ext, COMPRESSION, "Description" +ASSET_NAME, COMPRESSION, filename.ext, "Description" ``` Example: @@ -43,8 +43,8 @@ enum class AssetId : uint16_t { Tool: `tools/asset_packer.cc` -1. Parse `demo_assets.txt` -2. Read binary files from `assets/final/` +1. Parse workspace `assets.txt` +2. Read files from workspace `assets/` or `assets/common/` 3. Generate `assets.h` (enum definitions) 4. Generate `assets_data.cc` (embedded byte arrays) 5. Auto-triggered by CMake on manifest changes @@ -89,6 +89,21 @@ Runtime: First `GetAsset()` call invokes generator, caches result. - **Hardcoded procedural dimensions**: Assumes 256×256 RGBA8 - **No integrity checks**: No CRC/hash validation +## Developer Workflow + +**Add new asset:** +1. Place file in workspace `assets/` (or `assets/common/` for shared) +2. Edit workspace `assets.txt`: + ``` + MY_ASSET, NONE, assets/myfile.ext, "Description" + ``` +3. Rebuild: `cmake --build build -j4` (auto-triggered) +4. Use in code: `GetAsset(AssetId::MY_ASSET, &size)` + +**Modify existing asset:** +- Edit source file in `assets/final/` +- CMake auto-detects change and rebuilds + ## Planned Improvements See **TODO.md** for detailed task breakdown: |
