Skip to content

Commit

Permalink
CMake Port
Browse files Browse the repository at this point in the history
  • Loading branch information
illusion0001 committed Sep 5, 2024
1 parent c82a29f commit 41e23dc
Show file tree
Hide file tree
Showing 111 changed files with 1,160 additions and 4,240 deletions.
87 changes: 87 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Visual Studio generated .editorconfig file with C++ settings.
root = true

[*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]

# Visual C++ Code Style settings

cpp_generate_documentation_comments = xml

# Visual C++ Formatting settings
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
cpp_indent_braces = false
cpp_indent_multi_line_relative_to = statement_begin
cpp_indent_within_parentheses = align_to_parenthesis
cpp_indent_preserve_within_parentheses = true
cpp_indent_case_contents = true
cpp_indent_case_labels = true
cpp_indent_case_contents_when_block = false
cpp_indent_lambda_braces_when_parameter = true
cpp_indent_goto_labels = one_left
cpp_indent_preprocessor = leftmost_column
cpp_indent_access_specifiers = false
cpp_indent_namespace_contents = true
cpp_indent_preserve_comments = false
cpp_new_line_before_open_brace_namespace = new_line
cpp_new_line_before_open_brace_type = new_line
cpp_new_line_before_open_brace_function = new_line
cpp_new_line_before_open_brace_block = new_line
cpp_new_line_before_open_brace_lambda = new_line
cpp_new_line_scope_braces_on_separate_lines = true
cpp_new_line_close_brace_same_line_empty_type = false
cpp_new_line_close_brace_same_line_empty_function = false
cpp_new_line_before_catch = true
cpp_new_line_before_else = true
cpp_new_line_before_while_in_do_while = true
cpp_space_before_function_open_parenthesis = remove
cpp_space_within_parameter_list_parentheses = false
cpp_space_between_empty_parameter_list_parentheses = false
cpp_space_after_keywords_in_control_flow_statements = true
cpp_space_within_control_flow_statement_parentheses = false
cpp_space_before_lambda_open_parenthesis = false
cpp_space_within_cast_parentheses = false
cpp_space_after_cast_close_parenthesis = false
cpp_space_within_expression_parentheses = false
cpp_space_before_block_open_brace = true
cpp_space_between_empty_braces = false
cpp_space_before_initializer_list_open_brace = false
cpp_space_within_initializer_list_braces = true
cpp_space_preserve_in_initializer_list = true
cpp_space_before_open_square_bracket = false
cpp_space_within_square_brackets = false
cpp_space_before_empty_square_brackets = false
cpp_space_between_empty_square_brackets = false
cpp_space_group_square_brackets = true
cpp_space_within_lambda_brackets = false
cpp_space_between_empty_lambda_brackets = false
cpp_space_before_comma = false
cpp_space_after_comma = true
cpp_space_remove_around_member_operators = true
cpp_space_before_inheritance_colon = true
cpp_space_before_constructor_colon = true
cpp_space_remove_before_semicolon = true
cpp_space_after_semicolon = true
cpp_space_remove_around_unary_operator = true
cpp_space_around_binary_operator = insert
cpp_space_around_assignment_operator = insert
cpp_space_pointer_reference_alignment = left
cpp_space_around_ternary_operator = insert
cpp_use_unreal_engine_macro_formatting = true
cpp_wrap_preserve_blocks = never

# Visual C++ Inlcude Cleanup settings

cpp_include_cleanup_add_missing_error_tag_type = suggestion
cpp_include_cleanup_remove_unused_error_tag_type = dimmed
cpp_include_cleanup_optimize_unused_error_tag_type = suggestion
cpp_include_cleanup_sort_after_edits = false
cpp_sort_includes_error_tag_type = none
cpp_sort_includes_priority_case_sensitive = false
cpp_sort_includes_priority_style = quoted
cpp_includes_style = default
cpp_includes_use_forward_slash = true
134 changes: 84 additions & 50 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,20 @@ on:
push:
paths-ignore:
- '**/*.md'
- '**/*.txt'
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.txt'
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

env:
BUILD_CONFIGURATION: Release

permissions:
contents: write

jobs:
build:
runs-on: windows-latest
env:
BUILD_CONFIGURATION: ${{ github.workspace }}/out/build/x64-release
INSTALL_CONFIGURATION: ${{ github.workspace }}/out/install
BRANCH: ${{ github.ref_name }}
permissions:
contents: write
steps:
- name: Checkout main repository
uses: actions/checkout@main
Expand All @@ -39,6 +33,7 @@ jobs:
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@main
- name: Setup ScriptHook SDK
if: false
working-directory: source/RDR3.Patches/scripthook_sdk
run: |
$ScriptHookZip = "ScriptHookRDR2_SDK_1.0.1207.73.zip"
Expand All @@ -47,61 +42,76 @@ jobs:
# curl -fLJO http://www.dev-c.com/files/$ScriptHookZip
curl -fLJO https://github.com/illusion0001/ScriptHook-Mirrors/releases/download/mirrors/$ScriptHookZip
7z x $ScriptHookZip -aos
- name: Build x64
run: msbuild /m /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:Platform=x64 -maxcpucount:1 Windows-Game-Patches-x64.sln
- name: Build Win32
run: msbuild /m /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:Platform=x86 -maxcpucount:1 Windows-Game-Patches-Win32.sln
- name: Bundle loaders
- name: Setup VS environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Setup CMake Project (Release x64)
run: cmake --preset x64-release
- name: Build CMake Project (Release x64)
run: cmake --build ${{ env.BUILD_CONFIGURATION }}
- name: Install CMake Project (Release x64)
run: cmake --install ${{ env.BUILD_CONFIGURATION }}
- name: Bundle loaders and data files
working-directory: ${{ env.INSTALL_CONFIGURATION }}
run: |
Rename-Item x64-release x64
$ScriptHookZip = "ScriptHookRDR2_1.0.1491.17.zip"
$ASI_win32 = "Ultimate-ASI-Loader.zip"
$ASI_x64 = "Ultimate-ASI-Loader_x64.zip"
curl -fLJO https://github.com/illusion0001/ScriptHook-Mirrors/releases/download/mirrors/$ScriptHookZip
curl -fLJO https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases/latest/download/$ASI_x64
curl -fLJO https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases/latest/download/$ASI_win32
7z x $ScriptHookZip
7z x $ASI_x64 -o"${{ env.BUILD_CONFIGURATION }}/x64/!ASI_Loader_x64"
7z x $ASI_win32 -o"${{ env.BUILD_CONFIGURATION }}/Win32/!ASI_Loader_Win32"
Copy-Item bin/ScriptHookRDR2.dll ${{ env.BUILD_CONFIGURATION }}/x64/RDR3.Patches/
Copy-Item -Recurse -Force data/*/ ${{ env.BUILD_CONFIGURATION }}/
$dataFilesLink = "https://github.com/illusion0001/Windows-Game-Patches/releases/download/data-files"
$ASIDownloadLink = "https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases/latest/download"
# curl -fLJO https://github.com/illusion0001/ScriptHook-Mirrors/releases/download/mirrors/$ScriptHookZip
curl -fLJO $ASIDownloadLink/$ASI_x64
# curl -fLJO $ASIDownloadLink/$ASI_win32
# 7z x $ScriptHookZip
7z x $ASI_x64 -o"x64/!ASI_Loader_x64"
# Copy-Item bin/ScriptHookRDR2.dll ./x64/RDR3.Patches/
# Copy config files
Copy-Item -Recurse -Force ${{ github.workspace }}/data/*/ ./
- name: Clean output folder
run: Remove-Item -Path ${{ env.INSTALL_CONFIGURATION }} -Recurse -Include *.lib
- name: Generate Hash file
working-directory: ${{ env.BUILD_CONFIGURATION }}
working-directory: ${{ env.INSTALL_CONFIGURATION }}/x64
run: |
$asiFiles = Get-ChildItem -Path "." -Filter "*.asi" -Recurse
foreach ($file in $asiFiles) {
$hash = Get-FileHash -Path "$file" -Algorithm SHA512 | Format-List
$hash | Out-File -Append -FilePath "hashes.txt"
echo $hash
foreach ($file in $asiFiles)
{
$hash = Get-FileHash -Path "$file" -Algorithm SHA256 | Format-List
$hash | Out-File -Append -FilePath "${{ env.INSTALL_CONFIGURATION }}\hashes.txt"
echo $hash
}
- name: Upload artifact
if: github.event_name != 'workflow_dispatch'
uses: actions/upload-artifact@main
with:
name: ${{ env.zip_name }}
name: ${{ env.zip_name }}-x64-pdb
path: |
${{ env.BUILD_CONFIGURATION }}/**/*.asi
${{ env.BUILD_CONFIGURATION }}/**/*.dll
${{ env.BUILD_CONFIGURATION }}/**/*.ini
${{ env.BUILD_CONFIGURATION }}/hashes.txt
- name: Upload artifact
${{ env.INSTALL_CONFIGURATION }}/x64
${{ env.INSTALL_CONFIGURATION }}/hashes.txt
- name: Upload artifact (PDB)
if: github.event_name != 'workflow_dispatch'
uses: actions/upload-artifact@main
with:
name: ${{ env.zip_name }}-pdb
name: ${{ env.zip_name }}-x64
path: |
${{ env.BUILD_CONFIGURATION }}/**/*.asi
${{ env.BUILD_CONFIGURATION }}/**/*.ini
${{ env.BUILD_CONFIGURATION }}/**/*.pdb
${{ env.BUILD_CONFIGURATION }}/hashes.txt
- name: Create Release
if: |
github.event_name == 'workflow_dispatch' &&
github.repository == 'illusion0001/Windows-Game-Patches'
${{ env.INSTALL_CONFIGURATION }}/x64
!${{ env.INSTALL_CONFIGURATION }}/x64/**/*.pdb
${{ env.INSTALL_CONFIGURATION }}\hashes.txt
- name: Prepare Release
if: github.event_name == 'workflow_dispatch'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$hashMarkdown = @'
<details>
<summary>Readme Contents (Click to Expand)</summary>
{0}
</details>
<details>
<summary>ASI Plugin Hashes (Click to Expand)</summary>
Expand All @@ -110,13 +120,37 @@ jobs:
```
</details>
'@ -f (Get-Content ".github\README.md" | Out-String), (Get-Content "${{ env.BUILD_CONFIGURATION }}\hashes.txt" | Out-String)
'@ -f (Get-Content ".github\README.md" | Out-String), (Get-Content "${{ env.INSTALL_CONFIGURATION }}\hashes.txt" | Out-String)
$hashMarkdown | Out-File -FilePath hash.md
Get-Content hash.md
$compress = @{
Path = "${{ env.BUILD_CONFIGURATION }}\*"
DestinationPath = "${{ env.zip_name }}.zip"
Path = "${{ env.INSTALL_CONFIGURATION }}\x64", "${{ env.INSTALL_CONFIGURATION }}\hashes.txt"
DestinationPath = "${{ env.zip_name }}-x64-pdb.zip"
}
Compress-Archive @compress
gh release create ${{ env.commit_ver }} ${{ env.ZIP_NAME }}.zip --target ${{ GITHUB.SHA }} -t "${{ env.commit_ver }}" -F hash.md # --draft --prerelease
Remove-Item -Path ${{ env.INSTALL_CONFIGURATION }} -Recurse -Include *.pdb
$compress = @{
Path = "${{ env.INSTALL_CONFIGURATION }}\x64", "${{ env.INSTALL_CONFIGURATION }}\hashes.txt"
DestinationPath = "${{ env.zip_name }}-x64.zip"
}
Compress-Archive @compress
- name: Create Release
if: github.event_name == 'workflow_dispatch'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$prerelease = ""
if ("${{ env.BRANCH }}" -ieq "main")
{
$prerelease = ""
echo "Is main release"
}
else
{
$prerelease = "--prerelease"
echo "Is not main release: ${{ env.BRANCH }}"
}
& gh release create ${{ env.commit_ver }} ${{ env.zip_name }}-x64-pdb.zip ${{ env.zip_name }}-x64.zip --target ${{ GITHUB.SHA }} -t "${{ env.commit_ver }}" -F hash.md $prerelease
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*.so
*.dylib
*.dll
*.asi

# Fortran module files
*.mod
Expand All @@ -37,3 +38,12 @@
/**/Release
*.user
/**/git_ver.h

# CMake
_build/
build/
CMakeFiles/
vcpkg_installed/
CMakeUserPresets.json
out/

43 changes: 43 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
cmake_minimum_required(VERSION 3.20)

ADD_DEFINITIONS(-DUNICODE)
ADD_DEFINITIONS(-D_UNICODE)
ADD_DEFINITIONS(-D_USRDLL)

list(PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

set(CMAKE_CXX_STANDARD 17) # CXX17 for `filesystem`

project(Windows-Game-Patches CXX)

include_directories(
"${CMAKE_SOURCE_DIR}/include"
"${CMAKE_SOURCE_DIR}/external/inipp"
)

add_subdirectory(source/ACMirage.NoTAA)
add_subdirectory(source/ACUnity.Patches)
add_subdirectory(source/APT2.Patches)
# TODO: 32 bit project
# add_subdirectory(source/BF3.Patches)
add_subdirectory(source/BFV.NoTAA)
add_subdirectory(source/BrightMemoryInfinite.NoTAA)
add_subdirectory(source/Control.Patches)
add_subdirectory(source/DeadSpace.NoTAA)
add_subdirectory(source/DeathStranding.Fix)
add_subdirectory(source/EldenRing.NoTAA)
add_subdirectory(source/GotG.NoTAA)
add_subdirectory(source/GoW.NoTAA)
add_subdirectory(source/Hitman3.NoTAA)
add_subdirectory(source/LiesOfP.NoTAA)
add_subdirectory(source/NierReplicant.Fix)
add_subdirectory(source/PlanetOfLana.NoTAA)
# TODO: Figure out linking or ditch scriptHook
# add_subdirectory(source/RDR3.Patches)
add_subdirectory(source/RE4.Sharpness)
add_subdirectory(source/RE8.NoTAA)
add_subdirectory(source/Remnant2.NoTAA)
add_subdirectory(source/SpiderMan.MilesMorales.Patches)
add_subdirectory(source/T1X.DebugFeatures)
add_subdirectory(source/Uncharted4TLL.NoTAA)
add_subdirectory(source/WoLong.Fix)
Loading

0 comments on commit 41e23dc

Please sign in to comment.