diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf2c932b..aaee49fe 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 dpkg --add-architecture i386 && sudo apt-get install mingw-w64 ninja-build wine wine32:i386 - uses: actions/checkout@v4 diff --git a/game_patch/graphics/d3d11/gr_d3d11_mesh.cpp b/game_patch/graphics/d3d11/gr_d3d11_mesh.cpp index c5aab707..ae514cae 100644 --- a/game_patch/graphics/d3d11/gr_d3d11_mesh.cpp +++ b/game_patch/graphics/d3d11/gr_d3d11_mesh.cpp @@ -538,7 +538,7 @@ namespace df::gr::d3d11 v3d_ib_.clear(); } - BufferWrapper::BufferWrapper(unsigned initial_capacity, unsigned el_size, D3D11_BIND_FLAG bind_flag, ID3D11Device* device) : + BufferWrapper::BufferWrapper(unsigned initial_capacity, unsigned el_size, UINT bind_flag, ID3D11Device* device) : bind_flag_(bind_flag), capacity_(initial_capacity), el_size_(el_size) { create_buffer(device); diff --git a/game_patch/graphics/d3d11/gr_d3d11_mesh.h b/game_patch/graphics/d3d11/gr_d3d11_mesh.h index 69e24a4d..84e913b6 100644 --- a/game_patch/graphics/d3d11/gr_d3d11_mesh.h +++ b/game_patch/graphics/d3d11/gr_d3d11_mesh.h @@ -60,7 +60,7 @@ namespace df::gr::d3d11 class BufferWrapper { public: - BufferWrapper(unsigned initial_capacity, unsigned el_size, D3D11_BIND_FLAG bind_flag, ID3D11Device* device); + BufferWrapper(unsigned initial_capacity, unsigned el_size, UINT bind_flag, ID3D11Device* device); void write(void* data, unsigned n, RenderContext& render_context); void reserve(unsigned n, RenderContext& render_context); @@ -82,7 +82,7 @@ namespace df::gr::d3d11 private: ComPtr buffer_; unsigned size_ = 0; - D3D11_BIND_FLAG bind_flag_; + UINT bind_flag_; unsigned capacity_; unsigned el_size_; 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/launcher_common/CMakeLists.txt b/launcher_common/CMakeLists.txt index 2b45faaa..89be4226 100644 --- a/launcher_common/CMakeLists.txt +++ b/launcher_common/CMakeLists.txt @@ -32,4 +32,4 @@ target_include_directories(LauncherCommon ${CMAKE_CURRENT_SOURCE_DIR}/include/launcher_common ) -target_link_libraries(LauncherCommon Common Xlog sha1 ed25519 base64) +target_link_libraries(LauncherCommon dxgi Common Xlog sha1 ed25519 base64) 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);