summaryrefslogtreecommitdiff
path: root/tools/asset_packer.cc
AgeCommit message (Collapse)Author
26 hourstest(coverage): Improve Asset Manager coverage (Task #47)skal
Added tests for runtime error handling in Asset Manager (unknown function, generation failure). Updated asset_packer to warn instead of fail on unknown functions to facilitate testing. Increased coverage from 71% to 88%.
42 hoursrefactor: Task #20 - Platform & Code Hygieneskal
- Consolidated all WebGPU shims and platform-specific logic into src/platform.h. - Refactored platform_init to return PlatformState by value and platform_poll to automatically refresh time and aspect_ratio. - Removed STL dependencies (std::map, std::vector, std::string) from AssetManager and Procedural subsystems. - Fixed Windows cross-compilation by adjusting include paths and linker flags in CMakeLists.txt and updating build_win.sh. - Removed redundant direct inclusions of GLFW/glfw3.h and WebGPU headers across the project. - Applied clang-format and updated documentation. handoff(Gemini): Completed Task #20 and 20.1. Platform abstraction is now unified, and core paths are STL-free. Windows build is stable.
2 daysfix(assets): Resolve static initialization order fiascoskal
Replaces the global array with which wraps a local static array. This ensures the asset table is initialized on first use, preventing crashes when other globals (like shader strings) try to access assets during dynamic initialization.
2 daysfeat(assets): Enforce 16-byte alignment and string safetyskal
Updates asset_packer to align static asset arrays to 16 bytes and append a null-terminator. This allows assets to be safely reinterpreted as typed pointers (e.g., float*, const char*) without copying. Updates AssetManager documentation to reflect these guarantees.
3 daysrefactor(build): Centralize generated files and clean up project layoutskal
- Task A: Centralized all generated code (assets, timeline) into a single directory to create a single source of truth. - Task A: Isolated test asset generation into a temporary build directory, preventing pollution of the main source tree. - Task B: Vertically compacted all C/C++ source files by removing superfluous newlines. - Task C: Created a top-level README.md with project overview and file descriptions. - Task D: Moved non-essential documentation into a directory to reduce root-level clutter.
4 daysfeat(gpu/assets): Fix tests, integrate bumpy 3D renderer and procedural assetsskal
- Fixed test_sequence by restoring MainSequence::init_test for mocking. - Corrected CMakeLists.txt dependencies and source groupings to prevent duplicate symbols. - standardizing Effect constructor signature for seq_compiler compatibility. - Implemented Hybrid3DEffect using bumpy Renderer3D and procedural NOISE_TEX. - Updated MainSequence to support depth buffer for 3D elements. - Formatted all source files with clang-format.
4 daysfeat(gpu): Integrate bumpy 3D renderer into main demoskal
- Added depth buffer support to MainSequence. - Implemented Hybrid3DEffect for the main timeline. - Fixed effect initialization order in MainSequence. - Ensured depth-stencil compatibility for all scene effects. - Updated demo sequence with 3D elements and post-processing.
4 daysfeat(assets): Implement procedural asset generation pipelineskal
- Updated asset_packer to parse PROC(...) syntax. - Implemented runtime dispatch in AssetManager for procedural generation. - Added procedural generator functions (noise, grid, periodic). - Added comprehensive tests for procedural asset lifecycle.
4 daysfeat(asset_manager): Implement array-based cachingskal
- 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.
4 daysclang-formatskal
5 daysstyle: add vertical compression rules to clang-formatskal
- Enabled AllowShortFunctionsOnASingleLine: All - Enabled AllowShortBlocksOnASingleLine: Always - Enabled AllowShortIfStatementsOnASingleLine: Always - Enabled AllowShortLoopsOnASingleLine: true - Set MaxEmptyLinesToKeep: 1 - Applied formatting to all source files.
5 daysrefactor: move generated asset files to src/generated/skal
- Updated CMakeLists.txt to generate assets.h and assets_data.cc in src/generated/. - Updated scripts/gen_assets.sh to reflect the new output location. - Modified asset_packer.cc to generate correct include paths in assets_data.cc. - Updated source files (main.cc, asset_manager.cc, test_assets.cc) to include headers from the 'generated/' subdirectory. - Ensured all targets have correct include paths to find generated headers. - Removed stale generated files from src/.
8 daysstyle updateskal
8 daysfeat(assets): Add auto-generation comment to packer outputskal
Updates to prepend a warning comment to the generated and files, indicating they are auto-generated and should not be manually edited.
8 daysrefactor(assets): Optimize asset retrieval using array lookupskal
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.
8 daysdocs: Update project context and session notesskal
Summarizes recent implementations including Asset Management, audio/visual fixes, and style improvements.
8 daysstyle: Add 3-line descriptive headers to all source filesskal
This commit applies a new project-wide rule that every source file must begin with a concise 3-line comment header describing its purpose. - Updated CONTRIBUTING.md with the new rule. - Applied headers to all .cc and .h files in src/ and tools/. - Fixed various minor compilation errors and missing includes discovered during the header update process.
8 daystest(assets): Add functional tests for asset management systemskal
This commit makes the asset packer fully functional and adds an end-to-end test suite. - Updated asset_packer.cc to read file contents and embed them as hex arrays. - Added actual asset files (null.bin, test_asset.txt) for testing. - Implemented src/tests/test_assets.cc to verify data integrity at runtime. - Refactored CMakeLists.txt to handle generated file dependencies correctly.
8 daysfeat(assets): Implement basic asset packing systemskal
Introduces a new asset management system to embed binary assets directly into the demo executable. - Creates the directory for asset definition and an descriptor file. - Implements to generate (with enum and declaration) and (with placeholder data). - Integrates into CMake build, making depend on the generated asset files. - Adds minimal integration in and documentation in . This addresses Task 9 (compact in-line and off-line asset system).