spriteforge/docs/codegen-watch.md

21 lines
706 B
Markdown
Raw Permalink Normal View History

# Code generation and hot reload
After building a library, generate a dependency-free C99/C++17 header:
```powershell
sf codegen --build-dir build --output generated/spriteforge_assets.h
```
The header contains FNV-1a 32-bit enums for assets, animations and palettes,
plus a compact metadata table. Include it together with `sfa.h` or `sfa.hpp`.
Watch manifests and their declared `rig`/`source` files with:
```powershell
sf watch assets/items.yaml assets/monsters.yaml --jobs 4
```
The initial build and every successful rebuild atomically update
`build/reload.json`. A game can poll `sequence` and reload only the IDs listed
in `assets`. The signal is written after all build outputs are complete.