diff options
| -rw-r--r-- | CMakeLists.txt | 37 | ||||
| -rw-r--r-- | src/generated/assets_data.cc | 6 |
2 files changed, 38 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ff47cea..887e018 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,15 +181,42 @@ else() set(TRACKER_COMPILER_FINAL_DEPENDS ${TRACKER_COMPILER_DEPENDS}) endif() -#-- - Code Generation Helpers -- - +#-- - Code Generation Helpers -- - +# Helper to parse demo_assets.txt and extract individual file paths +function(parse_asset_list INPUT_TXT OUT_FILE_LIST) + set(ASSET_FILES "") + if(EXISTS ${INPUT_TXT}) + file(STRINGS ${INPUT_TXT} LINES) + foreach(LINE ${LINES}) + # Skip comments and empty lines + string(STRIP "${LINE}" LINE) + if(NOT LINE MATCHES "^#" AND NOT LINE STREQUAL "") + # Extract filename (third field: ASSET_NAME, COMPRESSION, FILENAME, DESC) + string(REGEX REPLACE "^[^,]+,[^,]+,[ ]*([^,]+).*" "\\1" FILENAME "${LINE}") + string(STRIP "${FILENAME}" FILENAME) + # Build full path + set(FULL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/assets/final/${FILENAME}") + if(EXISTS ${FULL_PATH}) + list(APPEND ASSET_FILES ${FULL_PATH}) + endif() + endif() + endforeach() + endif() + set(${OUT_FILE_LIST} ${ASSET_FILES} PARENT_SCOPE) +endfunction() + function(pack_assets NAME INPUT_TXT HEADER_VAR DATA_CC_VAR TARGET_NAME) set(OUT_H ${CMAKE_CURRENT_SOURCE_DIR}/src/generated/${NAME}.h) set(OUT_CC ${CMAKE_CURRENT_SOURCE_DIR}/src/generated/${NAME}_data.cc) + + # Parse asset list to get individual file dependencies + parse_asset_list(${INPUT_TXT} ASSET_FILE_DEPS) + add_custom_command( OUTPUT ${OUT_H} ${OUT_CC} COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_SOURCE_DIR}/src/generated COMMAND ${ASSET_PACKER_CMD} ${INPUT_TXT} ${OUT_H} ${OUT_CC} - DEPENDS ${ASSET_PACKER_DEPENDS} ${INPUT_TXT} + DEPENDS ${ASSET_PACKER_DEPENDS} ${INPUT_TXT} ${ASSET_FILE_DEPS} COMMENT "Generating assets for ${NAME}..." ) set(${HEADER_VAR} ${OUT_H} PARENT_SCOPE) @@ -201,11 +228,15 @@ endfunction() function(pack_test_assets NAME INPUT_TXT HEADER_VAR DATA_CC_VAR TARGET_NAME) set(OUT_H ${CMAKE_CURRENT_BINARY_DIR}/src/generated_test/${NAME}.h) set(OUT_CC ${CMAKE_CURRENT_BINARY_DIR}/src/generated_test/${NAME}_data.cc) + + # Parse asset list to get individual file dependencies + parse_asset_list(${INPUT_TXT} ASSET_FILE_DEPS) + add_custom_command( OUTPUT ${OUT_H} ${OUT_CC} COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/src/generated_test COMMAND ${ASSET_PACKER_CMD} ${INPUT_TXT} ${OUT_H} ${OUT_CC} - DEPENDS ${ASSET_PACKER_DEPENDS} ${INPUT_TXT} + DEPENDS ${ASSET_PACKER_DEPENDS} ${INPUT_TXT} ${ASSET_FILE_DEPS} COMMENT "Generating assets for test ${NAME}..." ) set(${HEADER_VAR} ${OUT_H} PARENT_SCOPE) diff --git a/src/generated/assets_data.cc b/src/generated/assets_data.cc index 0b2daba..a29680f 100644 --- a/src/generated/assets_data.cc +++ b/src/generated/assets_data.cc @@ -369584,7 +369584,7 @@ static const float ASSET_PROC_PARAMS_NOISE_TEX[] = {1234.000000, 16.000000}; static const char* ASSET_PROC_FUNC_STR_NOISE_TEX = "gen_noise"; -const size_t ASSET_SIZE_SHADER_RENDERER_3D = 9449; +const size_t ASSET_SIZE_SHADER_RENDERER_3D = 9468; alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDERER_3D[] = { 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x22, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, @@ -370373,7 +370373,9 @@ alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDERER_3D[] = { 0x6f, 0x73, 0x2e, 0x7a, 0x20, 0x2f, 0x20, 0x63, 0x6c, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x73, 0x2e, 0x77, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, - 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x00 + 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x20, 0x74, 0x65, 0x73, 0x74, 0x0a, + 0x00 }; const size_t ASSET_SIZE_SHADER_COMMON_UNIFORMS = 346; alignas(16) static const uint8_t ASSET_DATA_SHADER_COMMON_UNIFORMS[] = { |
