From a358fbc9f4ba3a7b01f600109fc86aeb2fcf96b8 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 1 Feb 2026 12:06:37 +0100 Subject: feat(asset_manager): Implement array-based caching - Refactored asset manager to use a static array for caching, improving performance and memory efficiency. - Updated asset_packer to correctly generate ASSET_LAST_ID for array sizing. - Modified asset_manager.h to use a forward declaration for AssetId. - Updated asset_manager.cc to use the conditional include for generated asset headers. - Added a test case in test_assets to verify the array-based cache and ASSET_LAST_ID logic. --- tools/asset_packer.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/asset_packer.cc') diff --git a/tools/asset_packer.cc b/tools/asset_packer.cc index c803c02..e606b94 100644 --- a/tools/asset_packer.cc +++ b/tools/asset_packer.cc @@ -112,6 +112,8 @@ int main(int argc, char* argv[]) { ++asset_id_counter; } + // Add ASSET_LAST_ID at the end + assets_h_file << " ASSET_LAST_ID = " << asset_id_counter << "\n"; assets_h_file << "};\n\n"; assets_h_file << "#include \"util/asset_manager.h\"\n"; assets_h_file.close(); -- cgit v1.2.3