Skip to content

Commit bf19c8c

Browse files
committed
Merge branch 'improve_crc_logging_ea' into headless_sh
2 parents 8d325d9 + bb744e7 commit bf19c8c

File tree

664 files changed

+3719
-30673
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

664 files changed

+3719
-30673
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml renamed to .github/ISSUE_TEMPLATE/bug-report.yaml

-1
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/ci.yml

+5-4
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

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[GEN]
2+
[ZH]
3+
[CMAKE]
4+
[GITHUB]
5+
[CORE]
6+
[LINUX]
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

Core/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ add_subdirectory(Libraries)
2222
# add_subdirectory(GameEngineDevice)
2323

2424
if (RTS_BUILD_CORE_TOOLS OR RTS_BUILD_CORE_EXTRAS)
25-
# add_subdirectory(Tools)
25+
add_subdirectory(Tools)
2626
endif()

Core/Libraries/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
add_subdirectory(Source/EABrowserDispatch)
1111
add_subdirectory(Source/EABrowserEngine)
12-
#add_subdirectory(Source/Compression)
12+
add_subdirectory(Source/Compression)
+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/*
2+
** Copyright 2025 Electronic Arts Inc.
3+
**
4+
** This program is free software: you can redistribute it and/or modify
5+
** it under the terms of the GNU General Public License as published by
6+
** the Free Software Foundation, either version 3 of the License, or
7+
** (at your option) any later version.
8+
**
9+
** This program is distributed in the hope that it will be useful,
10+
** but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
** GNU General Public License for more details.
13+
**
14+
** You should have received a copy of the GNU General Public License
15+
** along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
// FILE: BaseTypeCore.h ///////////////////////////////////////////////////////////
19+
//
20+
// Project: RTS3
21+
//
22+
// Basic types and constants
23+
// Author: Michael S. Booth, January 1995, September 2000
24+
// TheSuperHackers @compile feliwir 11/04/2025 Move common BaseType.h code to BaseTypeCore.h
25+
//
26+
///////////////////////////////////////////////////////////////////////////////
27+
28+
// tell the compiler to only load this file once
29+
#pragma once
30+
31+
32+
#ifndef _BASE_TYPE_CORE_H_
33+
#define _BASE_TYPE_CORE_H_
34+
35+
#include <math.h>
36+
#include <string.h>
37+
// TheSuperHackers @compile feliwir 07/04/2025 Adds utility macros for cross-platform compatibility
38+
#include <Utility/compat.h>
39+
#include <Utility/CppMacros.h>
40+
41+
/*
42+
** Turn off some unneeded warnings.
43+
** Within the windows headers themselves, Microsoft has disabled the warnings 4290, 4514,
44+
** 4069, 4200, 4237, 4103, 4001, 4035, 4164. Makes you wonder, eh?
45+
*/
46+
47+
// "unreferenced inline function has been removed" Yea, so what?
48+
#pragma warning(disable : 4514)
49+
50+
// Unreferenced local function removed.
51+
#pragma warning(disable : 4505)
52+
53+
// 'unreferenced formal parameter'
54+
#pragma warning(disable : 4100)
55+
56+
// 'identifier was truncated to '255' characters in the browser information':
57+
// Tempates create LLLOOONNNGGG identifiers!
58+
#pragma warning(disable : 4786)
59+
60+
// 'function selected for automatic inline expansion'. Cool, but since we're treating
61+
// warnings as errors, don't warn me about this!
62+
#pragma warning(disable : 4711)
63+
64+
#if 0
65+
// 'assignment within condition expression'. actually a pretty useful warning,
66+
// but way too much existing code violates it.
67+
//#pragma warning(disable : 4706)
68+
#else
69+
// actually, it turned out not to be too bad, so this is now ENABLED. (srj)
70+
#pragma warning(error : 4706)
71+
#endif
72+
73+
// 'conditional expression is constant'. used lots in debug builds.
74+
#pragma warning(disable : 4127)
75+
76+
// 'nonstandard extension used : nameless struct/union'. MS headers violate this...
77+
#pragma warning(disable : 4201)
78+
79+
// 'unreachable code'. STL violates this...
80+
#pragma warning(disable : 4702)
81+
82+
// 'local variable is initialized but not referenced'. good thing to know about...
83+
#pragma warning(error : 4189)
84+
85+
// 'unreferenced local variable'. good thing to know about...
86+
#pragma warning(error : 4101)
87+
88+
#ifndef PI
89+
#define PI 3.14159265359f
90+
#define TWO_PI 6.28318530718f
91+
#endif
92+
93+
#ifndef NULL
94+
//#define NULL ((void *)0)
95+
#define NULL 0 // C++ doesn't like casting void *'s into other pointers
96+
#endif
97+
98+
// MSVC math.h defines overloaded functions with this name...
99+
//#ifndef abs
100+
//#define abs(x) (((x) < 0) ? -(x) : (x))
101+
//#endif
102+
103+
#ifndef min
104+
#define min(x,y) (((x)<(y)) ? (x) : (y))
105+
#endif
106+
107+
#ifndef max
108+
#define max(x,y) (((x)>(y)) ? (x) : (y))
109+
#endif
110+
111+
#ifndef TRUE
112+
#define TRUE true
113+
#endif
114+
115+
#ifndef FALSE
116+
#define FALSE false
117+
#endif
118+
119+
// Elements in an array
120+
#ifndef ELEMENTS_OF
121+
#define ELEMENTS_OF( x ) ( sizeof( x ) / sizeof( x[0] ) )
122+
#endif
123+
124+
//--------------------------------------------------------------------
125+
// Fundamental type definitions
126+
//--------------------------------------------------------------------
127+
typedef float Real; // 4 bytes
128+
typedef int Int; // 4 bytes
129+
typedef unsigned int UnsignedInt; // 4 bytes
130+
typedef unsigned short UnsignedShort; // 2 bytes
131+
typedef short Short; // 2 bytes
132+
typedef unsigned char UnsignedByte; // 1 byte USED TO BE "Byte"
133+
typedef char Byte; // 1 byte USED TO BE "SignedByte"
134+
typedef char Char; // 1 byte of text
135+
typedef bool Bool; //
136+
// note, the types below should use "long long", but MSVC doesn't support it yet
137+
#ifdef _MSC_VER
138+
typedef __int64 Int64; // 8 bytes
139+
typedef unsigned __int64 UnsignedInt64; // 8 bytes
140+
#else
141+
typedef long long Int64; // 8 bytes
142+
typedef unsigned long long UnsignedInt64; // 8 bytes
143+
#endif
144+
145+
#endif // _BASE_TYPE_CORE_H_

GeneralsMD/Code/Libraries/Source/Compression/CMakeLists.txt renamed to Core/Libraries/Source/Compression/CMakeLists.txt

+8-7
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,22 @@ set(COMPRESSION_SRC
1919
Compression.h
2020
)
2121

22-
add_library(z_compression STATIC)
23-
set_target_properties(z_compression PROPERTIES OUTPUT_NAME compression)
22+
add_library(core_compression STATIC)
23+
set_target_properties(core_compression PROPERTIES OUTPUT_NAME compression)
2424

25-
target_sources(z_compression PRIVATE ${COMPRESSION_SRC})
25+
target_sources(core_compression PRIVATE ${COMPRESSION_SRC})
2626

27-
target_include_directories(z_compression INTERFACE
27+
target_include_directories(core_compression INTERFACE
2828
.
2929
)
3030

31-
target_link_libraries(z_compression PRIVATE
31+
target_link_libraries(core_compression PRIVATE
3232
core_config
33-
zi_always
33+
core_utility
34+
corei_libraries_include
3435
)
3536

36-
target_link_libraries(z_compression PUBLIC
37+
target_link_libraries(core_compression PUBLIC
3738
liblzhl
3839
libzlib
3940
)

GeneralsMD/Code/Libraries/Source/Compression/Compression.h renamed to Core/Libraries/Source/Compression/Compression.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#ifndef __COMPRESSION_H__
2626
#define __COMPRESSION_H__
2727

28-
#include "Lib/BaseType.h"
28+
#include "Lib/BaseTypeCore.h"
2929

3030
enum CompressionType
3131
{

GeneralsMD/Code/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp renamed to Core/Libraries/Source/Compression/LZHCompress/NoxCompress.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include <stdio.h>
2424
#include <stdlib.h>
25-
#include "Lib/BaseType.h"
25+
#include "Lib/BaseTypeCore.h"
2626
#include "NoxCompress.h"
2727
#include "CompLibHeader/lzhl.h"
2828

Core/Libraries/Source/EABrowserDispatch/BrowserDispatch.idl

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ library BROWSERDISPATCHLib
2525
]
2626
interface IBrowserDispatch : IUnknown
2727
{
28-
[id(1), helpstring("method TestMethod")] HRESULT TestMethod(Int num1);
28+
[id(1), helpstring("method TestMethod")] HRESULT TestMethod(int num1);
2929
};
3030
};

Core/Libraries/Source/EABrowserEngine/BrowserEngine.idl

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
//
33
// typelib filename: <could not determine filename>
44

5+
// NOTE: Import of oaidl.idl has been added to fix compilation error with widl:
6+
// BrowserEngine.idl:31:44: error: type 'IDispatch' not found in global namespace
7+
import "oaidl.idl";
58
[
69
uuid(6EE45698-21BA-420D-AD40-1B547699BEFB),
710
version(1.0)

Core/Tools/CMakeLists.txt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Build tools
2+
3+
# Build useful tool binaries.
4+
if(RTS_BUILD_CORE_TOOLS)
5+
# TODO: add subdirectory...
6+
endif()
7+
8+
# Build less useful tool/test binaries.
9+
if(RTS_BUILD_CORE_EXTRAS)
10+
add_subdirectory(Compress)
11+
endif()

Core/Tools/Compress/CMakeLists.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
set(COMRPESS_SRC
2+
"Compress.cpp"
3+
)
4+
5+
add_executable(core_compress WIN32)
6+
set_target_properties(core_compress PROPERTIES OUTPUT_NAME compress)
7+
8+
target_sources(core_compress PRIVATE ${COMRPESS_SRC})
9+
10+
target_link_libraries(core_compress PRIVATE
11+
core_config
12+
core_compression
13+
zi_always
14+
)
15+
16+
if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows")
17+
if(IS_VS6_BUILD)
18+
target_compile_definitions(core_compress PRIVATE vsnprintf=_vsnprintf)
19+
endif()
20+
target_link_options(core_compress PRIVATE /subsystem:console)
21+
endif()

0 commit comments

Comments
 (0)