# dxwrapper (zlib; github.com/elishacloud/dxwrapper): translates the game's # DirectDraw 7 / Direct3D 7 to Direct3D 9, lifting D3D7's 2048x2048 render # target limit. Pinned release, verified by hash; installed next to # sacred_re.dll in dxwrapper/ and loaded by src/mods/dxwrapper.cpp, so the # game folder stays untouched. include(FetchContent) # Some CMake builds (e.g. WinLibs/MinGW) ship curl without a CA store, so # HTTPS downloads fail certificate verification. Fall back to Git for # Windows' bundle when nothing else is configured. if(NOT CMAKE_TLS_CAINFO AND NOT DEFINED ENV{SSL_CERT_FILE}) file(TO_CMAKE_PATH "$ENV{ProgramFiles}" _program_files) foreach(_bundle "${_program_files}/Git/mingw64/etc/ssl/certs/ca-bundle.crt" "${_program_files}/Git/mingw64/ssl/certs/ca-bundle.crt") if(EXISTS "${_bundle}") set(CMAKE_TLS_CAINFO "${_bundle}") break() endif() endforeach() endif() FetchContent_Declare(dxwrapper_bin URL https://github.com/elishacloud/dxwrapper/releases/download/v1.8.8600.25/dxwrapper.zip URL_HASH SHA256=3894368ebce69f348d08e189c2f0818c49aa3b18ad01e06348743bf6a29af97a DOWNLOAD_EXTRACT_TIMESTAMP TRUE ) FetchContent_MakeAvailable(dxwrapper_bin) function(sacred_re_install_dxwrapper target) set(_dest "$/dxwrapper") add_custom_command(TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${_dest}" COMMAND ${CMAKE_COMMAND} -E copy_if_different "${dxwrapper_bin_SOURCE_DIR}/Stub/ddraw.dll" "${dxwrapper_bin_SOURCE_DIR}/dxwrapper.dll" "${dxwrapper_bin_SOURCE_DIR}/License.txt" "${CMAKE_SOURCE_DIR}/config/dxwrapper.ini" "${_dest}" VERBATIM) endfunction()