From d572203c41cfff817465fc3cddcdea56d5d7d9f8 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 3 Mar 2026 09:00:50 +0100 Subject: 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. --- src/util/asset_manager.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/util/asset_manager.h') 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); -- cgit v1.2.3