Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
b98918e
unify(client): Move ParabolicEase, CameraShakeSystem to Core (#1904)
xezon Nov 23, 2025
a40d246
unify(view): Merge View and closely related code (#1904)
xezon Nov 24, 2025
fe4a589
unify(view): Move View, W3DView to Core (#1904)
xezon Nov 27, 2025
7751544
refactor: Remove all explicit AsciiString instantiations from C strin…
xezon Nov 30, 2025
963d7f7
refactor: Remove superfluous variable init comments (#1876)
bobtista Nov 30, 2025
2a1f963
bugfix(filesystem): Prevent loading wrong INIZH.big from Data/INI dir…
bobtista Nov 30, 2025
0410990
refactor: Remove all explicit UnicodeString instantiations from C str…
xezon Nov 30, 2025
94354fd
refactor(string): Fix constness of TheEmptyString (#1930)
xezon Dec 1, 2025
cc9d649
build: Add WOW6432Node to registry path lookups for EA App install pa…
bobtista Dec 2, 2025
29bf57a
refactor(network): Replace implicit conversion from NULL to AsciiStri…
Caball009 Dec 2, 2025
1ee44db
refactor: Remove or replace some superfluous empty C strings (#1929)
xezon Dec 2, 2025
d81e743
bugfix(movie): Fix Campaign, Challenge, Score movie cancellation or d…
xezon Dec 2, 2025
b6c1c54
tweak(keyboard): Apply minor improvements to Keyboard class to query …
xezon Nov 30, 2025
e6c28a4
feat(movie): Implement ESC button mapping to skip Campaign, Challenge…
xezon Nov 30, 2025
6f9785f
build: Use cmake_host_system_information to make registry queries in …
bobtista Dec 7, 2025
2a1593e
bugfix(network): Prevent out of bounds memory access in NetCommandWra…
Mauller Dec 7, 2025
2b1bcee
fix: Wrong usage of sizeof(this) in BitFlags::xfer(), W3DMPO::glueEnf…
bobtista Dec 7, 2025
aed42f0
refactor(mouse): Apply minor refactoring and whitespace tweaks in Win…
xezon Dec 2, 2025
68d832f
bugfix(mouse): Prevent cursor capture when mouse is outside of app wi…
xezon Dec 2, 2025
f4608df
feat(crashdump): Add crash dump functionality for fatal errors (#1594)
slurmlord Dec 7, 2025
158b046
ci(vcpkg): Include preset in binary cache key to avoid ABI mismatches…
bobtista Dec 10, 2025
42f846b
bugfix(pathfinder): Prevent infinite loop within PathfindCell::putOnS…
Mauller Dec 10, 2025
9573250
build: Add clang-tidy checks and script (#1807)
bobtista Dec 10, 2025
e6e874e
bugfix(string): Allow startsWith and endsWith to be called on empty s…
Caball009 Dec 11, 2025
d2625f0
refactor: Remove superfluous inline and register keywords with clang-…
bobtista Dec 11, 2025
3209a5b
unify(matpass): Merge WW3D2 matpass code (#1982)
xezon Dec 11, 2025
d809648
refactor(namekey): Reduce code duplication in NameKeyGenerator functi…
xezon Dec 7, 2025
0c993a9
perf(namekey): Remove all superfluous AsciiString allocations for nam…
xezon Dec 11, 2025
38abe9e
bugfix(network): Prevent buffer overflow in NetPacket::readFileMessag…
Mauller Dec 13, 2025
c5aa3cd
fix(network): Fix missing value initialization of LANGameInfo::m_isDi…
bobtista Dec 13, 2025
746c017
refactor: Apply the readability-container-size-empty check with clang…
bobtista Dec 14, 2025
fa9cb0c
unify(texture): Merge W3DWater and WW3D2 texture code (#1989)
xezon Dec 13, 2025
c110a0e
unify(texture): Move W3DWater, W3DLaserDraw and WW3D2 texture related…
xezon Dec 14, 2025
334f56a
build(heightmap): Fix include paths in Zero Hour Height Map files (#1…
xezon Dec 13, 2025
330ad22
unify(heightmap): Merge Height Map related code and move Zero Hour's …
xezon Dec 14, 2025
ce4e595
unify(heightmap): Move Height Map and Terrain related files to Core (…
xezon Dec 14, 2025
844c436
bugfix(input): Disable mouse waypoint mode after using alt tab (#1987)
Caball009 Dec 16, 2025
123492c
bugfix(object): Fix visibility conditions for client-side effects (#1…
Stubbjax Dec 17, 2025
4951762
bugfix(experience): Prevent ranking of riders that are not trainable …
Stubbjax Dec 17, 2025
bffbcb4
refactor: Apply integer value comparisons for strcmp and stricmp with…
bobtista Dec 17, 2025
3b7e734
build: Implement docker build (#1774)
sherif181 Dec 17, 2025
fc36efc
bugfix(network): Fix data offset for string reads in NetPacket::readF…
Mauller Dec 18, 2025
23a2926
tweak(metaevent): Change COMMANDUSABLE_OBSERVER to no longer apply in…
xezon Dec 19, 2025
09e6ce7
bugfix(network): Assign disconnect frame when quitting the game via t…
Stubbjax Dec 20, 2025
529675f
chore: Implement scripts for custom isEmpty() and singleton refs clan…
bobtista Dec 20, 2025
1f2c1a3
bugfix(input): Replace frame-based timings with real-time timings in …
bobtista Dec 21, 2025
03b9ae8
bugfix(aiupdate): Repairing Chinooks and Helixes no longer take off a…
Stubbjax Dec 21, 2025
646e3dd
bugfix(aiupdate): Chinooks and Helixes no longer take off after repai…
Stubbjax Dec 21, 2025
b878990
refactor: Apply clang-tidy fixes for generals-use-this-instead-of-sin…
bobtista Dec 21, 2025
abd092c
refactor: Apply clang-tidy fixes for generals-use-is-empty (#2018)
bobtista Dec 22, 2025
e616d82
fix(logic): Fix unexpected return in GameLogic::logicMessageDispatche…
bobtista Dec 22, 2025
5dba2a0
perf(audio): Optimize fail condition order in AudioManager::addAudioE…
bobtista Dec 22, 2025
2b37732
refactor(audio): Simplify volume related code in AudioManager and Mil…
xezon Dec 30, 2025
20927af
ci(vcpkg): Stabilize vcpkg binary caching; add compiler-aware keys an…
bobtista Dec 30, 2025
f5ccc9c
bugfix(aiupdate): Invalidate build task of Dozers and Workers if the …
Stubbjax Dec 31, 2025
a4c76b9
perf(contain): Optimize Object::isHero with cached hero counter (#1841)
bobtista Dec 31, 2025
5e8f1b8
refactor(network): Simplify error prone net packet size calculations …
bobtista Dec 31, 2025
ae22809
refactor(logic): Simplify code in GameLogic's init, reset, startNewGa…
stephanmeesters Jan 2, 2026
224017e
bugfix(heightmap): Disable old uv adjument for cliffs (#2038)
xezon Jan 2, 2026
5deddce
bugfix(heightmap): Fix dynamic lights on terrain (#2039)
xezon Jan 2, 2026
13de427
perf(weaponstore): Optimize WeaponStore::findWeaponTemplatePrivate wi…
IamInnocent3X Jan 2, 2026
409fed2
bugfix(thingfactory): Reset next ThingTemplate ID after clearing cust…
Caball009 Jan 3, 2026
f2da2b6
tweak(drawable): Set correct model tint color after loading a save ga…
Caball009 Jan 3, 2026
ae05f11
bugfix(aiupdate): Prevent manually ejecting rappelling Rangers during…
Stubbjax Jan 3, 2026
afa8aa3
bugfix(ai): Undetected mines can now be approached when using a disar…
Stubbjax Jan 3, 2026
0d6c776
bugfix(lobby): Properly sort CRC mismatched game rooms to the bottom …
bobtista Jan 4, 2026
925ecf1
perf(ai): Avoid a few std::vector copies when passing ai paths to fun…
bobtista Jan 4, 2026
8cbcd78
tweak(drawable): Decouple stealth detected opacity fade time step fro…
xezon Jan 4, 2026
20adf33
bugfix(audio): UI audio no longer plays at maximum volume for a singl…
Stubbjax Jan 4, 2026
3eea715
bugfix(object): Do not apply veterancy bonuses and animations for dea…
Stubbjax Jan 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
167 changes: 167 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# TheSuperHackers @build JohnsterID 15/09/2025 Add clang-tidy configuration for code quality analysis
---
# Clang-tidy configuration for GeneralsGameCode project
# This configuration is tailored for a legacy C++98/C++20 hybrid codebase
# with Windows-specific code and COM interfaces

# Enable specific checks that are appropriate for this codebase
Checks: >
-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions,
-bugprone-signed-char-misuse,
cert-*,
-cert-dcl21-cpp,
-cert-dcl50-cpp,
-cert-dcl58-cpp,
-cert-env33-c,
-cert-err58-cpp,
clang-analyzer-*,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-no-malloc,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
google-*,
-google-build-using-namespace,
-google-explicit-constructor,
-google-readability-casting,
-google-readability-todo,
-google-runtime-int,
-google-runtime-references,
hicpp-*,
-hicpp-avoid-c-arrays,
-hicpp-explicit-conversions,
-hicpp-no-array-decay,
-hicpp-signed-bitwise,
-hicpp-special-member-functions,
-hicpp-uppercase-literal-suffix,
-hicpp-use-auto,
-hicpp-vararg,
misc-*,
-misc-const-correctness,
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes,
-misc-use-anonymous-namespace,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-raw-string-literal,
-modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-default-member-init,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
performance-*,
-performance-avoid-endl,
portability-*,
readability-*,
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-convert-member-functions-to-static,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-named-parameter,
-readability-redundant-access-specifiers,
-readability-uppercase-literal-suffix

# Treat warnings as errors for CI/CD
WarningsAsErrors: false

# Header filter to include project headers
HeaderFilterRegex: '(Core|Generals|GeneralsMD|Dependencies)/.*\.(h|hpp)$'

# Check options for specific rules
CheckOptions:
# Naming conventions - adapted for the existing codebase style
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: CamelCase
- key: readability-identifier-naming.MethodCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.MemberPrefix
value: m_
- key: readability-identifier-naming.ConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.EnumConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE

# Performance settings
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: true
- key: performance-unnecessary-value-param.AllowedTypes
value: 'AsciiString;UnicodeString;Utf8String;Utf16String'

# Modernize settings - be conservative for legacy code
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm

# Readability settings
- key: readability-function-size.LineThreshold
value: 150
- key: readability-function-size.StatementThreshold
value: 100
- key: readability-function-size.BranchThreshold
value: 25
- key: readability-function-size.ParameterThreshold
value: 8
- key: readability-function-size.NestingThreshold
value: 6

# Bugprone settings
- key: bugprone-argument-comment.StrictMode
value: false
- key: bugprone-suspicious-string-compare.WarnOnImplicitComparison
value: true
- key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison
value: true

# Google style settings
- key: google-readability-braces-around-statements.ShortStatementLines
value: 2
- key: google-readability-function-size.StatementThreshold
value: 100

# CERT settings
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: false

# Use .clang-format for formatting suggestions
FormatStyle: file

# Exclude certain directories and files
# Note: This is handled by HeaderFilterRegex above, but can be extended
85 changes: 69 additions & 16 deletions .github/workflows/build-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,16 @@ jobs:
name: ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }}
runs-on: windows-2022
timeout-minutes: 30

env:
VCPKG_FILE_CACHE: ${{ github.workspace }}\vcpkg-bincache
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}\vcpkg-bincache,readwrite
VCPKG_FEATURE_FLAGS: manifests,versions,binarycaching

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Cache vcpkg binary artifacts
uses: actions/cache@v4
with:
path: ${{ github.workspace }}\vcpkg-bincache
key: vcpkg-bincache-${{ runner.os }}-${{ hashFiles('vcpkg.json','vcpkg-lock.json') }}
restore-keys: |
vcpkg-bincache-${{ runner.os }}-

- name: Cache VC6 Installation
if: startsWith(inputs.preset, 'vc6')
id: cache-vc6
Expand Down Expand Up @@ -111,15 +105,65 @@ jobs:
with:
arch: x86

- name: Compute vcpkg cache key parts
if: startsWith(inputs.preset, 'win32')
id: vcpkg_key
shell: pwsh
run: |
$baseline = (Get-Content vcpkg.json | ConvertFrom-Json)."builtin-baseline"

$msvc = $env:VCToolsVersion
if (-not $msvc) { $msvc = "unknown" }

# Reduce churn: keep major.minor (e.g. 14.44)
$msvcMajorMinor = ($msvc -split '\.')[0..1] -join '.'

$triplet = "x86-windows"
if ("${{ inputs.preset }}" -like "x64*") { $triplet = "x64-windows" }

"baseline=$baseline" >> $env:GITHUB_OUTPUT
"msvc=$msvcMajorMinor" >> $env:GITHUB_OUTPUT
"triplet=$triplet" >> $env:GITHUB_OUTPUT

Write-Host "vcpkg cache key parts: baseline=$baseline, msvc=$msvcMajorMinor, triplet=$triplet"

- name: Restore vcpkg binary cache
if: startsWith(inputs.preset, 'win32')
id: vcpkg_cache
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}\vcpkg-bincache
key: vcpkg-bincache-v2-${{ runner.os }}-msvc${{ steps.vcpkg_key.outputs.msvc }}-baseline${{ steps.vcpkg_key.outputs.baseline }}-${{ steps.vcpkg_key.outputs.triplet }}
restore-keys: |
vcpkg-bincache-v2-${{ runner.os }}-msvc${{ steps.vcpkg_key.outputs.msvc }}-baseline${{ steps.vcpkg_key.outputs.baseline }}-
vcpkg-bincache-v2-${{ runner.os }}-

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
runVcpkgInstall: false
doNotCache: true

- name: Configure vcpkg to use cached directory
if: startsWith(inputs.preset, 'win32')
shell: pwsh
run: |
$cacheDir = "${{ github.workspace }}\vcpkg-bincache"
New-Item -ItemType Directory -Force -Path $cacheDir | Out-Null

# lukka/run-vcpkg sets its own temp cache dir; override to force our cached dir
$env:VCPKG_DEFAULT_BINARY_CACHE = $cacheDir
$env:VCPKG_BINARY_SOURCES = "clear;files,$cacheDir,readwrite"

"VCPKG_DEFAULT_BINARY_CACHE=$cacheDir" >> $env:GITHUB_ENV
"VCPKG_BINARY_SOURCES=$env:VCPKG_BINARY_SOURCES" >> $env:GITHUB_ENV

- name: Configure ${{ inputs.game }} with CMake Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Preset
shell: pwsh
run: |
$buildFlags = @(
"-DRTS_BUILD_ZEROHOUR=${{ inputs.game == 'GeneralsMD' && 'ON' || 'OFF' }}",
"-DRTS_BUILD_GENERALS=${{ inputs.game == 'Generals' && 'ON' || 'OFF' }}"
"-DRTS_BUILD_ZEROHOUR=${{ inputs.game == 'GeneralsMD' && 'ON' || 'OFF' }}",
"-DRTS_BUILD_GENERALS=${{ inputs.game == 'Generals' && 'ON' || 'OFF' }}"
)

$gamePrefix = "${{ inputs.game == 'Generals' && 'GENERALS' || 'ZEROHOUR' }}"
Expand All @@ -129,27 +173,36 @@ jobs:
$buildFlags += "-DRTS_BUILD_${gamePrefix}_EXTRAS=${{ inputs.extras && 'ON' || 'OFF' }}"

Write-Host "Build flags: $($buildFlags -join ' | ')"

cmake --preset ${{ inputs.preset }} $buildFlags

- name: Build ${{ inputs.game }} with CMake Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Preset
shell: pwsh
run: |
cmake --build --preset ${{ inputs.preset }}

- name: Save vcpkg binary cache
# Only one job should save to avoid "Unable to reserve cache" conflicts.
if: ${{ startsWith(inputs.preset, 'win32') && steps.vcpkg_cache.outputs.cache-hit != 'true' && inputs.game == 'Generals' && inputs.preset == 'win32-vcpkg-debug' }}
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}\vcpkg-bincache
key: vcpkg-bincache-v2-${{ runner.os }}-msvc${{ steps.vcpkg_key.outputs.msvc }}-baseline${{ steps.vcpkg_key.outputs.baseline }}-${{ steps.vcpkg_key.outputs.triplet }}

- name: Collect ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Artifact
shell: pwsh
run: |
$buildDir = "build\${{ inputs.preset }}"
$artifactsDir = New-Item -ItemType Directory -Force -Path "$buildDir\${{ inputs.game }}\artifacts" -Verbose

if ("${{ inputs.preset }}" -like "win32*") {
# For win32 preset, look in config-specific subdirectories
if ("${{ inputs.preset }}" -like "win32*") {
$configToUse = if ("${{ inputs.preset }}" -match "debug") { "Debug" } else { "Release" }
$files = Get-ChildItem -Path "$buildDir\Core\$configToUse","$buildDir\${{ inputs.game }}\$configToUse" -File | Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") } -Verbose
} else {
$files = Get-ChildItem -Path "$buildDir\Core","$buildDir\${{ inputs.game }}" -File | Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") } -Verbose
$files = Get-ChildItem -Path "$buildDir\Core\$configToUse","$buildDir\${{ inputs.game }}\$configToUse" -File |
Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") } -Verbose
} else {
$files = Get-ChildItem -Path "$buildDir\Core","$buildDir\${{ inputs.game }}" -File |
Where-Object { $_.Extension -in @(".exe", ".dll", ".pdb") } -Verbose
}

$files | Move-Item -Destination $artifactsDir -Verbose -Force

- name: Upload ${{ inputs.game }} ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Artifact
Expand Down
Loading