summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-01 12:06:37 +0100
committerskal <pascal.massimino@gmail.com>2026-02-01 12:06:37 +0100
commita358fbc9f4ba3a7b01f600109fc86aeb2fcf96b8 (patch)
treea08b085bc74b5d41382d9818377ff8c31802ad85 /tools
parentf80e37bd61e447f1d66fbb5eb4c1ab7a8a77cf0f (diff)
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.
Diffstat (limited to 'tools')
-rw-r--r--tools/asset_packer.cc2
1 files changed, 2 insertions, 0 deletions
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();