summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-01-28 09:45:18 +0100
committerskal <pascal.massimino@gmail.com>2026-01-28 09:45:18 +0100
commit438333cf6f1dcd9f8d6a94fc702a952b070353b4 (patch)
treeb3690e9fa22037d9fbb8c2f0ffa77767ac6b5db2 /CMakeLists.txt
parentb8d42b0ccdc3ead63e541c9d38ca33bfe7bf7c65 (diff)
refactor(assets): Optimize asset retrieval using array lookup
This refactors the asset management system to be more efficient and cleaner. - Moved common GetAsset/DropAsset logic to src/util/asset_manager.cc. - Changed retrieval to use an array of records (AssetRecord) for O(1) lookups instead of a switch statement. - Updated asset_packer to generate only raw data and the record array.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d460131..f752a63 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,6 +93,7 @@ add_executable(demo64k
src/audio/idct.cc
src/audio/window.cc
src/audio/synth.cc
+ src/util/asset_manager.cc
third_party/glfw3webgpu/glfw3webgpu.c
${GENERATED_ASSETS_DATA_CC}
)
@@ -155,6 +156,7 @@ if(DEMO_BUILD_TESTS)
add_executable(test_assets
src/tests/test_assets.cc
+ src/util/asset_manager.cc
${GENERATED_ASSETS_DATA_CC}
)
target_include_directories(test_assets PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src src)