Skip to content

Commit 4e93b31

Browse files
committed
2 parents b13777a + adf9c71 commit 4e93b31

884 files changed

Lines changed: 5913 additions & 35816 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: Bug Report
22
description: Report bugs or issues you've encountered while playing the game
3-
title: "[Bug]: "
43
type: Bug
54
labels: [ "Bug", "⚠️ Triage" ]
65

.github/workflows/build-toolchain.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ jobs:
106106
shell: pwsh
107107
run: |
108108
$buildFlags = @(
109-
"-DGENZH_BUILD_ZEROHOUR=${{ inputs.game == 'GeneralsMD' && 'ON' || 'OFF' }}",
110-
"-DGENZH_BUILD_GENERALS=${{ inputs.game == 'Generals' && 'ON' || 'OFF' }}"
109+
"-DRTS_BUILD_ZEROHOUR=${{ inputs.game == 'GeneralsMD' && 'ON' || 'OFF' }}",
110+
"-DRTS_BUILD_GENERALS=${{ inputs.game == 'Generals' && 'ON' || 'OFF' }}"
111111
)
112112
113113
$gamePrefix = "${{ inputs.game == 'Generals' && 'GENERALS' || 'ZEROHOUR' }}"
114-
$buildFlags += "-DGENZH_BUILD_${gamePrefix}_TOOLS=${{ inputs.tools && 'ON' || 'OFF' }}"
115-
$buildFlags += "-DGENZH_BUILD_${gamePrefix}_EXTRAS=${{ inputs.extras && 'ON' || 'OFF' }}"
114+
$buildFlags += "-DRTS_BUILD_${gamePrefix}_TOOLS=${{ inputs.tools && 'ON' || 'OFF' }}"
115+
$buildFlags += "-DRTS_BUILD_${gamePrefix}_EXTRAS=${{ inputs.extras && 'ON' || 'OFF' }}"
116116
117117
Write-Host "Build flags: $buildFlags"
118118

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ jobs:
4141
generalsmd:
4242
- 'GeneralsMD/**'
4343
shared:
44-
- 'Dependencies/**'
45-
- 'cmake/**'
44+
- '.github/workflows/build-toolchain.yml'
45+
- '.github/workflows/ci.yml'
4646
- 'CMakeLists.txt'
4747
- 'CMakePresets.json'
48-
- ".github/workflows/ci.yml"
49-
- '.github/workflows/build-toolchain.yml'
48+
- 'cmake/**'
49+
- 'Core/**'
50+
- 'Dependencies/**'
5051
5152
- name: Changes Summary
5253
run: |

.github/workflows/valid-tags.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[GEN]
2+
[ZH]
3+
[CMAKE]
4+
[GITHUB]
5+
[CORE]
6+
[LINUX]
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Validate Pull Request
2+
3+
permissions:
4+
contents: read
5+
pull-requests: write
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- main
11+
types:
12+
- opened
13+
- edited
14+
- synchronize
15+
- reopened
16+
17+
jobs:
18+
validate-title-and-commits:
19+
name: Validate Title and Commits
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 5
22+
23+
steps:
24+
- name: Checkout Code
25+
uses: actions/checkout@v4
26+
27+
- name: Load valid tags
28+
id: load-tags
29+
run: |
30+
if [ ! -f ./.github/workflows/valid-tags.txt ]; then
31+
echo "::error::.github/workflows/valid-tags.txt file not found"
32+
exit 1
33+
fi
34+
35+
echo "**Valid tags**: $(cat ./.github/workflows/valid-tags.txt | tr '\n' ',' | sed 's/,/, /g' | sed 's/, $//')" >> $GITHUB_STEP_SUMMARY
36+
37+
TAG_REGEX=$(sed 's/[]\/$*.^|[]/\\&/g' ./.github/workflows/valid-tags.txt | paste -sd "|" -)
38+
39+
# Matches:
40+
# 1) One or more valid tags at the beginning, directly adjacent, followed by at least one space, then text
41+
# 2) Text that does not start with '[' (i.e. no tags)
42+
echo "regex=^((($TAG_REGEX)){1,}[[:space:]]+.*|[^[]+.*)$" >> $GITHUB_OUTPUT
43+
44+
echo "Built the regex: ^((($TAG_REGEX)){1,}[[:space:]]+.*|[^[]+.*)$"
45+
46+
- name: Validate PR title
47+
id: validate_title
48+
run: |
49+
echo "### Validate PR Title" >> $GITHUB_STEP_SUMMARY
50+
REGEX="${{ steps.load-tags.outputs.regex }}"
51+
TITLE=$(jq -r '.pull_request.title // "No title found"' "$GITHUB_EVENT_PATH")
52+
53+
ESCAPED_TITLE=$(echo "$TITLE" | sed 's/["\`\\$]/\\&/g')
54+
55+
if [[ ! "$TITLE" =~ $REGEX ]]; then
56+
echo "- ❌ PR title \"$ESCAPED_TITLE\" is invalid." >> $GITHUB_STEP_SUMMARY
57+
echo "TITLE_VALID=false" >> $GITHUB_OUTPUT
58+
else
59+
echo "- ✅ PR title \"$ESCAPED_TITLE\" is valid." >> $GITHUB_STEP_SUMMARY
60+
echo "TITLE_VALID=true" >> $GITHUB_OUTPUT
61+
fi
62+
63+
- name: Validate PR commits
64+
id: validate_commits
65+
run: |
66+
echo "### Validate PR Commits" >> $GITHUB_STEP_SUMMARY
67+
REGEX="${{ steps.load-tags.outputs.regex }}"
68+
git fetch --prune --unshallow origin ${{ github.base_ref }}
69+
COMMITS=$(git log origin/${{ github.base_ref }}..HEAD --pretty=format:"%s" --no-merges)
70+
71+
INVALID_COMMITS=0
72+
73+
while read -r COMMIT_MSG; do
74+
if [[ -z "$COMMIT_MSG" ]]; then
75+
continue
76+
fi
77+
ESCAPED_MSG=$(echo "$COMMIT_MSG" | sed 's/["\`\\$]/\\&/g')
78+
if [[ ! "$COMMIT_MSG" =~ $REGEX ]]; then
79+
echo "- ❌ Commit message \"$ESCAPED_MSG\" is invalid." >> $GITHUB_STEP_SUMMARY
80+
INVALID_COMMITS=$((INVALID_COMMITS+1))
81+
else
82+
echo "- ✅ Commit message \"$ESCAPED_MSG\" is valid." >> $GITHUB_STEP_SUMMARY
83+
fi
84+
done <<< "$COMMITS"
85+
86+
if [[ $INVALID_COMMITS -gt 0 ]]; then
87+
echo "COMMITS_VALID=false" >> $GITHUB_OUTPUT
88+
else
89+
echo "COMMITS_VALID=true" >> $GITHUB_OUTPUT
90+
fi
91+
92+
- name: Validation return code
93+
run: |
94+
if [[ "${{ steps.validate_title.outputs.TITLE_VALID }}" != "true" || "${{ steps.validate_commits.outputs.COMMITS_VALID }}" != "true" ]]; then
95+
exit 1
96+
fi

CMakeLists.txt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@ include(FetchContent)
4242
if((WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4)
4343
include(cmake/miles.cmake)
4444
include(cmake/bink.cmake)
45-
if (IS_VS6_BUILD)
46-
include(cmake/stlport.cmake)
47-
else()
48-
add_library(stlport INTERFACE) # Do not use stlport
49-
endif()
5045
include(cmake/dx8.cmake)
5146
include(cmake/dbghelp.cmake)
5247
endif()
5348

49+
# Define a dummy stlport target when not on VC6.
50+
if (IS_VS6_BUILD)
51+
include(cmake/stlport.cmake)
52+
else()
53+
add_library(stlport INTERFACE)
54+
endif()
55+
5456
include(cmake/config.cmake)
5557
include(cmake/gamespy.cmake)
5658
include(cmake/lzhl.cmake)
@@ -66,12 +68,14 @@ add_subdirectory(Dependencies/SafeDisc)
6668
add_subdirectory(Dependencies/Utility)
6769
add_subdirectory(resources)
6870

71+
add_subdirectory(Core)
72+
6973
# Add main build targets
70-
if(GENZH_BUILD_ZEROHOUR)
74+
if(RTS_BUILD_ZEROHOUR)
7175
add_subdirectory(GeneralsMD)
7276
endif()
7377

74-
if(GENZH_BUILD_GENERALS)
78+
if(RTS_BUILD_GENERALS)
7579
add_subdirectory(Generals)
7680
endif()
7781

CMakePresets.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL",
1818
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "$<$<CONFIG:Release,Debug,RelWithDebInfo>:ProgramDatabase>",
1919
"CMAKE_BUILD_TYPE": "Release",
20-
"GENZH_FLAGS": "/W3"
20+
"RTS_FLAGS": "/W3"
2121
},
2222
"vendor": {
2323
"jetbrains.com/clion": {
@@ -31,15 +31,15 @@
3131
"hidden": false,
3232
"inherits": "vc6",
3333
"cacheVariables": {
34-
"GENZH_BUILD_PROFILE": "ON"
34+
"RTS_BUILD_OPTION_PROFILE": "ON"
3535
}
3636
},
3737
{
3838
"name": "vc6int",
3939
"displayName": "Build Internal Binaries with NMake",
4040
"inherits": "vc6",
4141
"cacheVariables": {
42-
"GENZH_BUILD_INTERNAL": "ON"
42+
"RTS_BUILD_OPTION_INTERNAL": "ON"
4343
}
4444
},
4545
{
@@ -49,7 +49,7 @@
4949
"inherits": "vc6",
5050
"cacheVariables": {
5151
"CMAKE_BUILD_TYPE": "Debug",
52-
"GENZH_BUILD_DEBUG": "ON"
52+
"RTS_BUILD_OPTION_DEBUG": "ON"
5353
}
5454
},
5555
{
@@ -74,7 +74,7 @@
7474
"strategy": "external"
7575
},
7676
"cacheVariables": {
77-
"GENZH_FLAGS": "/W3"
77+
"RTS_FLAGS": "/W3"
7878
},
7979
"vendor": {
8080
"jetbrains.com/clion": {
@@ -87,23 +87,23 @@
8787
"inherits": "win32",
8888
"displayName": "Windows 32bit Profile build",
8989
"cacheVariables": {
90-
"GENZH_BUILD_PROFILE": "ON"
90+
"RTS_BUILD_OPTION_PROFILE": "ON"
9191
}
9292
},
9393
{
9494
"name": "win32int",
9595
"inherits": "win32",
9696
"displayName": "Windows 32bit Internal build",
9797
"cacheVariables": {
98-
"GENZH_BUILD_INTERNAL": "ON"
98+
"RTS_BUILD_OPTION_INTERNAL": "ON"
9999
}
100100
},
101101
{
102102
"name": "win32dbg",
103103
"inherits": "win32",
104104
"displayName": "Windows 32bit Debug build",
105105
"cacheVariables": {
106-
"GENZH_BUILD_DEBUG": "ON"
106+
"RTS_BUILD_OPTION_DEBUG": "ON"
107107
}
108108
},
109109
{

Core/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Generated files
2+
BrowserDispatch_i.c
3+
BrowserDispatch.h
4+
BrowserDispatch.tlb
5+
generatedVersion.h
6+
7+
# Generated shader headers
8+
*.vsh_code.h
9+
*.psh_code.h
10+
11+
# Visual C++ files
12+
*.ncb
13+
*.opt
14+
*.plg

Core/CMakeLists.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# c stands for core, i stands for Interface
2+
add_library(corei_libraries_include INTERFACE)
3+
add_library(corei_always INTERFACE)
4+
5+
target_include_directories(corei_libraries_include INTERFACE "Libraries/Include")
6+
target_link_libraries(corei_always INTERFACE
7+
core_utility
8+
corei_libraries_include
9+
)
10+
11+
# Do we want to build extra SDK stuff or just the game binary?
12+
option(RTS_BUILD_CORE_TOOLS "Build core tools" ON)
13+
add_feature_info(CoreTools GENZH_BUILD_ZEROHOUR_TOOLS "Build Core Mod Tools")
14+
option(RTS_BUILD_CORE_EXTRAS "Build core extra tools/tests" OFF)
15+
add_feature_info(CoreExtras GENZH_BUILD_ZEROHOUR_EXTRAS "Build Core Extra Tools/Tests")
16+
17+
# Set where the build results will end up
18+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
19+
20+
# Contains internal libraries
21+
add_subdirectory(Libraries)
22+
23+
# Base GameEngine library
24+
# add_subdirectory(GameEngine)
25+
26+
# Platform specific GameEngine code
27+
# add_subdirectory(GameEngineDevice)
28+
29+
if (RTS_BUILD_CORE_TOOLS OR RTS_BUILD_CORE_EXTRAS)
30+
add_subdirectory(Tools)
31+
endif()

Core/Libraries/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# WW common libraries decended from earliest C&C games
2+
#add_subdirectory(Source/WWVegas)
3+
4+
# profiling library
5+
#add_subdirectory(Source/profile)
6+
7+
# debugging library
8+
#add_subdirectory(Source/debug)
9+
10+
add_subdirectory(Source/EABrowserDispatch)
11+
add_subdirectory(Source/EABrowserEngine)
12+
add_subdirectory(Source/Compression)

0 commit comments

Comments
 (0)