Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalh committed Sep 1, 2024
1 parent a85a651 commit a6bdfe1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:

- name: Install packages
run: sudo apt-get install mingw-w64 ninja-build
run: sudo dpkg --add-architecture i386 && sudo apt-get install mingw-w64 ninja-build wine32

- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion game_patch/hud/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ ConsoleCommand2 bighud_cmd{
"bighud",
};

#ifdef DEBUG
#ifndef NDEBUG
ConsoleCommand2 hud_coords_cmd{
"d_hud_coords",
[](int idx, std::optional<int> x, std::optional<int> y) {
Expand Down
19 changes: 12 additions & 7 deletions resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions resources/shaders/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions tools/shader_compiler/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<char*>(shader_data), shader_size);
shader_bytecode->Release();
printf("Shader byte code size: %ld\n", shader_size);
Expand Down

0 comments on commit a6bdfe1

Please sign in to comment.