summaryrefslogtreecommitdiff
path: root/src/util/asset_manager_dcl.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-06 10:16:50 +0100
committerskal <pascal.massimino@gmail.com>2026-02-06 10:16:50 +0100
commite281b6ff0884a5b4af8aa2ca79fd01141bc2005b (patch)
treeb6c33df6a2667fc4852b277275765eea15bac89f /src/util/asset_manager_dcl.h
parent98ab690a5e6c5b038a3842dd071848c0059971ae (diff)
refactor(build): Split asset_manager.h into dcl/core/utils headers
Split monolithic asset_manager.h (61 lines) into 3 focused headers: - asset_manager_dcl.h: Forward declarations (AssetId, ProcGenFunc) - asset_manager.h: Core API (GetAsset, DropAsset, AssetRecord) - asset_manager_utils.h: Typed helpers (TextureAsset, MeshAsset) Updated 17 source files to use appropriate headers: - object.h: Uses dcl.h (only needs AssetId forward declaration) - 7 files using TextureAsset/MeshAsset: Use utils.h - 10 files using only GetAsset(): Keep asset_manager.h Performance improvement: - Before: Touch asset_manager.h → 4.82s (35 files rebuild) - After: Touch asset_manager_utils.h → 2.01s (24 files rebuild) - Improvement: 58% faster for common workflow (tweaking mesh/texture helpers) Note: Touching base headers (dcl/core) still triggers ~33 file rebuilds due to object.h dependency chain. Further optimization would require reducing object.h's footprint (separate task). Files changed: - Created: asset_manager_dcl.h, asset_manager_utils.h - Modified: asset_manager.h (removed structs), asset_manager.cc - Updated: object.h, visual_debug.h, renderer_mesh.cc, flash_cube_effect.cc, hybrid_3d_effect.cc, test files
Diffstat (limited to 'src/util/asset_manager_dcl.h')
-rw-r--r--src/util/asset_manager_dcl.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util/asset_manager_dcl.h b/src/util/asset_manager_dcl.h
new file mode 100644
index 0000000..bf618f0
--- /dev/null
+++ b/src/util/asset_manager_dcl.h
@@ -0,0 +1,16 @@
+// This file is part of the 64k demo project.
+// Forward declarations for asset management system.
+// Use this header when you only need AssetId type.
+
+#pragma once
+#include <cstddef>
+#include <cstdint>
+
+enum class AssetId : uint16_t; // Forward declaration
+
+// Type for procedural generation functions: (buffer, width, height, params,
+// num_params)
+// Returns true on success, false on failure.
+typedef bool (*ProcGenFunc)(uint8_t*, int, int, const float*, int);
+
+struct AssetRecord; // Forward declaration (opaque)