Skip to content

Commit

Permalink
Add support for Hitman 3 CTT
Browse files Browse the repository at this point in the history
  • Loading branch information
OrfeasZ committed Nov 20, 2022
1 parent 0667949 commit 6286c5e
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ jobs:

strategy:
matrix:
buildpreset: [ Release, Debug ]
buildpreset:
- Release
- Debug
- Release-CTT
- Debug-CTT

steps:
- name: Get latest CMake and ninja
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -376,3 +376,5 @@ MigrationBackup/
FodyWeavers.xsd
/_build/
/_install/

out/
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
15 changes: 15 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand All @@ -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" ]
}
]
}
4 changes: 4 additions & 0 deletions ZHMModSDK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions ZHMModSDK/Include/Glacier/ZActor.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,13 @@ class ZActorManager :


public:
#if CTT
PAD(0x1F60);
TEntityRef<ZActor> m_aActiveActors[1000]; // 0x1F68, ZActorManager destructor, last if
#else
PAD(0x25A0);
TEntityRef<ZActor> m_aActiveActors[1000]; // 0x25A8, ZActorManager destructor, last if
#endif
/*PAD(0xAA20); // 0x5DE8
ZActorSavableHandler* m_pSavableHandler; // 0x10808*/
};

0 comments on commit 6286c5e

Please sign in to comment.