diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf2c932b..ab3826a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Install packages - run: sudo apt-get install mingw-w64 ninja-build + run: sudo apt-get install mingw-w64 ninja-build wine32 - uses: actions/checkout@v4 diff --git a/game_patch/hud/hud.cpp b/game_patch/hud/hud.cpp index 25836069..eb4245a3 100644 --- a/game_patch/hud/hud.cpp +++ b/game_patch/hud/hud.cpp @@ -168,7 +168,7 @@ ConsoleCommand2 bighud_cmd{ "bighud", }; -#ifdef DEBUG +#ifndef NDEBUG ConsoleCommand2 hud_coords_cmd{ "d_hud_coords", [](int idx, std::optional x, std::optional y) { diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index bc74f36a..66badfe8 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -5,15 +5,20 @@ else() endif() function(add_packfile packfile_name) + + list(TRANSFORM ARGN REPLACE "([^:]*):.*" "\\1" OUTPUT_VARIABLE input_deps) + list(TRANSFORM ARGN REPLACE "[^:]*:(.*)" "\\1" OUTPUT_VARIABLE input_paths) + add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/bin/${packfile_name} - COMMAND ${VPP_TOOL} -c ${CMAKE_BINARY_DIR}/bin/${packfile_name} ${ARGN} - DEPENDS ${ARGN} + COMMAND ${VPP_TOOL} -c ${CMAKE_BINARY_DIR}/bin/${packfile_name} ${input_paths} + DEPENDS ${input_deps} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) add_custom_target(${packfile_name} ALL DEPENDS ${CMAKE_BINARY_DIR}/bin/${packfile_name}) endfunction() + add_packfile(dashfaction.vpp maps_df.txt @@ -83,11 +88,11 @@ add_packfile(dashfaction.vpp meshes/coffeesmokedtbl2.v3m meshes/coffeesmokedtblAlt.v3m - ${CMAKE_BINARY_DIR}/shaders/standard_vs.bin - ${CMAKE_BINARY_DIR}/shaders/character_vs.bin - ${CMAKE_BINARY_DIR}/shaders/transformed_vs.bin - ${CMAKE_BINARY_DIR}/shaders/standard_ps.bin - ${CMAKE_BINARY_DIR}/shaders/ui_ps.bin + standard_vs:${CMAKE_BINARY_DIR}/shaders/standard_vs.bin + character_vs:${CMAKE_BINARY_DIR}/shaders/character_vs.bin + transformed_vs:${CMAKE_BINARY_DIR}/shaders/transformed_vs.bin + standard_ps:${CMAKE_BINARY_DIR}/shaders/standard_ps.bin + ui_ps:${CMAKE_BINARY_DIR}/shaders/ui_ps.bin ) # Copy licensing-info.txt diff --git a/resources/shaders/CMakeLists.txt b/resources/shaders/CMakeLists.txt index e35d65c0..8efe8143 100644 --- a/resources/shaders/CMakeLists.txt +++ b/resources/shaders/CMakeLists.txt @@ -7,6 +7,7 @@ endif() function(add_shader TARGET_NAME SRC_FILE TARGET_LEVEL) set(SHADER_OUTPUT ${CMAKE_BINARY_DIR}/shaders/${TARGET_NAME}.bin) + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/shaders") add_custom_command( OUTPUT ${SHADER_OUTPUT} COMMAND ${SHADER_COMPILER} -O3 -t ${TARGET_LEVEL} ${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FILE} -o ${SHADER_OUTPUT} diff --git a/tools/shader_compiler/main.cpp b/tools/shader_compiler/main.cpp index 385e4f7f..0e545fb2 100644 --- a/tools/shader_compiler/main.cpp +++ b/tools/shader_compiler/main.cpp @@ -137,6 +137,10 @@ int main(int argc, char* argv[]) auto shader_size = shader_bytecode->GetBufferSize(); auto shader_data = shader_bytecode->GetBufferPointer(); std::fstream output_file{output_filename.c_str(), std::ios_base::out | std::ios_base::binary}; + if (!output_file) { + printf("Failed to open output file: %s\n", output_filename.c_str()); + return 1; + } output_file.write(static_cast(shader_data), shader_size); shader_bytecode->Release(); printf("Shader byte code size: %ld\n", shader_size);