diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-01 14:27:14 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-01 14:27:14 +0100 |
| commit | c7087fa3004349943d9b76e5015e87314b366de4 (patch) | |
| tree | f688245d5bec66fb3eaea81e6ce38bc8dd63ebde /src/util/asset_manager.h | |
| parent | a358fbc9f4ba3a7b01f600109fc86aeb2fcf96b8 (diff) | |
feat(assets): Implement procedural asset generation pipeline
- Updated asset_packer to parse PROC(...) syntax.
- Implemented runtime dispatch in AssetManager for procedural generation.
- Added procedural generator functions (noise, grid, periodic).
- Added comprehensive tests for procedural asset lifecycle.
Diffstat (limited to 'src/util/asset_manager.h')
| -rw-r--r-- | src/util/asset_manager.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/util/asset_manager.h b/src/util/asset_manager.h index 6b09430..00aafc0 100644 --- a/src/util/asset_manager.h +++ b/src/util/asset_manager.h @@ -8,10 +8,16 @@ enum class AssetId : uint16_t; // Forward declaration +// Type for procedural generation functions: (buffer, width, height, params, num_params) +typedef void (*ProcGenFunc)(uint8_t*, int, int, const float*, int); + struct AssetRecord { - const uint8_t* data; - size_t size; - bool is_procedural; // Flag to indicate if memory was allocated dynamically + const uint8_t* data; // Pointer to asset data (static or dynamic) + size_t size; // Size of the asset data + bool is_procedural; // True if data was dynamically allocated by a procedural generator + const char* proc_func_name_str; // Name of procedural generation function (string literal) + const float* proc_params; // Parameters for procedural generation (static, from assets.txt) + int num_proc_params; // Number of procedural parameters }; // Generic interface |
