diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-03 09:00:50 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-03 09:00:50 +0100 |
| commit | d572203c41cfff817465fc3cddcdea56d5d7d9f8 (patch) | |
| tree | 12d55401510fb658416dcd3aead47a14f046061a /src/util/asset_manager.h | |
| parent | c229f3c6b5756d5cbbdad6049b4250ebea7aae7a (diff) | |
feat(assets): replace is_procedural/is_gpu_procedural bools with AssetType enum, add MP3 type
- Add AssetType enum {STATIC, PROC, PROC_GPU, MP3} to AssetRecord
- Add GetAssetType() API to asset_manager.h/cc
- asset_packer: parse 'MP3' compression keyword in assets.txt
- tracker: remove magic-byte is_mp3_asset(); use GetAssetType() instead
- assets.txt: NEVER_MP3 now uses 'MP3' compression type
- doc/ASSET_SYSTEM.md: rewritten to document new types and API
handoff(Gemini): AssetType enum landed; MP3 detection is now explicit via asset metadata.
Diffstat (limited to 'src/util/asset_manager.h')
| -rw-r--r-- | src/util/asset_manager.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/util/asset_manager.h b/src/util/asset_manager.h index 1714c21..09483e5 100644 --- a/src/util/asset_manager.h +++ b/src/util/asset_manager.h @@ -5,12 +5,12 @@ #pragma once #include "asset_manager_dcl.h" +enum class AssetType : uint8_t { STATIC, PROC, PROC_GPU, MP3 }; + struct AssetRecord { 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 - bool is_gpu_procedural; // True if GPU compute shader generates texture + AssetType type; const char* proc_func_name_str; // Name of procedural generation function // (string literal) const float* proc_params; // Parameters for procedural generation (static, @@ -30,6 +30,9 @@ void DropAsset(AssetId asset_id, const uint8_t* asset); // found. AssetId GetAssetIdByName(const char* name); +// Returns the AssetType for a given asset id. +AssetType GetAssetType(AssetId asset_id); + #if !defined(STRIP_ALL) // Hot-reload: Parse and reload assets from config file (debug only) bool ReloadAssetsFromFile(const char* config_path); |
