diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 397b46b5..b94d646c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,11 @@ jobs: strategy: matrix: - buildpreset: [ Release, Debug ] + buildpreset: + - Release + - Debug + - Release-CTT + - Debug-CTT steps: - name: Get latest CMake and ninja @@ -94,7 +98,15 @@ jobs: strategy: matrix: - artifact: [ ZHMModSDK-Release, ZHMModSDK-Debug, DevPkg-ZHMModSDK-Release, DevPkg-ZHMModSDK-Debug ] + artifact: + - ZHMModSDK-Release + - ZHMModSDK-Debug + - DevPkg-ZHMModSDK-Release + - DevPkg-ZHMModSDK-Debug + - ZHMModSDK-Release-CTT + - ZHMModSDK-Debug-CTT + - DevPkg-ZHMModSDK-Release-CTT + - DevPkg-ZHMModSDK-Debug-CTT steps: - name: Download artifact diff --git a/.gitignore b/.gitignore index 9dfabb74..6a5cd0b5 100644 --- a/.gitignore +++ b/.gitignore @@ -376,3 +376,5 @@ MigrationBackup/ FodyWeavers.xsd /_build/ /_install/ + +out/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 29b6d9c7..8012360a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,8 @@ endif() project(ZHMMods CXX) +set(CTT OFF CACHE BOOL "Build with support for the Hitman 3 CTT.") + set(CMAKE_CXX_STANDARD 23) if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") diff --git a/CMakePresets.json b/CMakePresets.json index 7411c670..9d9e2ff6 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -41,6 +41,11 @@ "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" }, "hidden": true }, + { + "name": "CTT", + "cacheVariables": { "CTT": true }, + "hidden": true + }, { "name": "x64-Debug", "description": "MSVC for x64 (Debug)", @@ -50,6 +55,16 @@ "name": "x64-Release", "description": "MSVC for x64 (Release)", "inherits": [ "base", "Release" ] + }, + { + "name": "x64-Debug-CTT", + "description": "MSVC for x64 (Debug) for CTT", + "inherits": [ "x64-Debug", "CTT" ] + }, + { + "name": "x64-Release-CTT", + "description": "MSVC for x64 (Release) for CTT", + "inherits": [ "x64-Release", "CTT" ] } ] } \ No newline at end of file diff --git a/ZHMModSDK/CMakeLists.txt b/ZHMModSDK/CMakeLists.txt index 55f86fd3..1f606d3d 100644 --- a/ZHMModSDK/CMakeLists.txt +++ b/ZHMModSDK/CMakeLists.txt @@ -25,6 +25,10 @@ target_compile_definitions(ZHMModSDK PRIVATE LOADER_EXPORTS ) +if (CTT) + target_compile_definitions(ZHMModSDK PUBLIC CTT) +endif() + target_link_libraries(ZHMModSDK PUBLIC minhook spdlog_header_only diff --git a/ZHMModSDK/Include/Glacier/ZActor.h b/ZHMModSDK/Include/Glacier/ZActor.h index aef0f3b6..ba1dd4a0 100644 --- a/ZHMModSDK/Include/Glacier/ZActor.h +++ b/ZHMModSDK/Include/Glacier/ZActor.h @@ -272,8 +272,13 @@ class ZActorManager : public: +#if CTT + PAD(0x1F60); + TEntityRef m_aActiveActors[1000]; // 0x1F68, ZActorManager destructor, last if +#else PAD(0x25A0); TEntityRef m_aActiveActors[1000]; // 0x25A8, ZActorManager destructor, last if +#endif /*PAD(0xAA20); // 0x5DE8 ZActorSavableHandler* m_pSavableHandler; // 0x10808*/ };