Skip to content

Commit 0d640ec

Browse files
committed
chore: Apply clang-format to entire codebase
1 parent 81fffb3 commit 0d640ec

4,056 files changed

Lines changed: 516838 additions & 498934 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.

.clang-format

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Language: Cpp
2+
Standard: c++20
3+
4+
# 1. Non-Destructive Core Setting
5+
# ------------------------------------------------------------------------------
6+
# Completely disable automatic line wrapping to preserve manual formatting.
7+
ColumnLimit: 0
8+
9+
# 2. Indentation & Tabs
10+
# ------------------------------------------------------------------------------
11+
UseTab: ForIndentation
12+
IndentWidth: 2
13+
TabWidth: 2
14+
ContinuationIndentWidth: 2
15+
AccessModifierOffset: -2
16+
IndentCaseLabels: true
17+
AlignTrailingComments: false
18+
SpacesBeforeTrailingComments: 4
19+
20+
# 3. Braces Style: Allman
21+
# ------------------------------------------------------------------------------
22+
BreakBeforeBraces: Custom
23+
BraceWrapping:
24+
AfterCaseLabel: true
25+
AfterClass: true
26+
AfterControlStatement: Always
27+
AfterEnum: true
28+
AfterFunction: true
29+
AfterNamespace: true
30+
AfterStruct: true
31+
AfterUnion: true
32+
BeforeCatch: true
33+
BeforeElse: true
34+
IndentBraces: false
35+
SplitEmptyFunction: false
36+
SplitEmptyRecord: false
37+
AllowShortEnumsOnASingleLine: false
38+
39+
# 4. Pointers & Spaces
40+
# ------------------------------------------------------------------------------
41+
PointerAlignment: Left
42+
SpacesInParentheses: false
43+
BreakConstructorInitializers: BeforeComma
44+
SpacesInAngles: Leave
45+
46+
# 5. Legacy & Compatibility (VC6 / Custom Macros)
47+
# ------------------------------------------------------------------------------
48+
# Prevent expanding/collapsing short blocks and functions to minimize diffs
49+
AllowShortFunctionsOnASingleLine: All
50+
AllowShortBlocksOnASingleLine: Always
51+
AlignEscapedNewlines: DontAlign
52+
Cpp11BracedListStyle: false
53+
54+
# Handle custom legacy macros so the parser doesn't break
55+
Macros:
56+
- CPP_11(x)=x
57+
58+
IndentPPDirectives: BeforeHash
59+
ConstructorInitializerIndentWidth: 2
60+
61+
# 6. Includes
62+
# ------------------------------------------------------------------------------
63+
SortIncludes: false

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ CPackSourceConfig.cmake
4444
thumbs.db
4545
/CMakeUserPresets.json
4646
/.cache
47-
.clang-format
4847
/.vscode
4948
/Dependencies/MaxSDK/maxsdk
5049
/tmp/

Core/GameEngine/Include/Common/AcademyStats.h

Lines changed: 67 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -61,43 +61,41 @@ class ThingTemplate;
6161

6262
struct AcademyAdviceInfo
6363
{
64-
UnicodeString advice[ MAX_ADVICE_TIPS ];
64+
UnicodeString advice[MAX_ADVICE_TIPS];
6565
UnsignedInt numTips;
6666
};
6767

68-
enum AcademyClassificationType CPP_11(: Int)
68+
enum AcademyClassificationType CPP_11( : Int)
6969
{
70-
//Don't forget to update the strings too!
70+
// Don't forget to update the strings too!
7171
ACT_NONE,
7272
ACT_UPGRADE_RADAR,
7373
ACT_SUPERPOWER,
7474

7575
ACT_COUNT
7676
};
77-
extern const char *const TheAcademyClassificationTypeNames[]; //Change above, change this!
78-
77+
extern const char* const TheAcademyClassificationTypeNames[]; // Change above, change this!
7978

8079
// ----------------------------------------------------------------------------------------------
8180
class AcademyStats : public Snapshot
8281
{
8382

8483
public:
85-
8684
AcademyStats();
8785

88-
void init( const Player *player );
86+
void init(const Player* player);
8987
void update();
9088

9189
Bool isFirstUpdate() const { return m_firstUpdate; }
92-
void setFirstUpdate( Bool set ) { m_firstUpdate = set; }
90+
void setFirstUpdate(Bool set) { m_firstUpdate = set; }
9391

94-
void recordProduction( const Object *obj, const Object *constructor );
95-
void recordUpgrade( const UpgradeTemplate *upgrade, Bool granted );
96-
void recordSpecialPowerUsed( const SpecialPowerTemplate *spTemplate );
92+
void recordProduction(const Object* obj, const Object* constructor);
93+
void recordUpgrade(const UpgradeTemplate* upgrade, Bool granted);
94+
void recordSpecialPowerUsed(const SpecialPowerTemplate* spTemplate);
9795
void recordIncome();
9896

9997
void recordBuildingCapture() { m_structuresCaptured++; }
100-
void recordGeneralsPointsSpent( Int points ) { m_generalsPointsSpent += points; }
98+
void recordGeneralsPointsSpent(Int points) { m_generalsPointsSpent += points; }
10199
void recordBuildingGarrisoned() { m_structuresGarrisoned++; }
102100
void recordDragSelection() { m_dragSelectUnits++; }
103101
void recordStrategyCenter() { m_hadAStrategyCenter = TRUE; }
@@ -108,169 +106,168 @@ class AcademyStats : public Snapshot
108106
void recordVehicleDisguised() { m_vehiclesDisguised++; }
109107
void recordFirestormCreated() { m_firestormsCreated++; }
110108
void recordGuardAbilityUsed() { m_guardAbilityUsedCount++; }
111-
void recordSalvageCollected() { m_salvageCollected++;}
109+
void recordSalvageCollected() { m_salvageCollected++; }
112110
void recordDoubleClickAttackMoveOrderGiven() { m_doubleClickAttackMoveOrdersGiven++; }
113111
void recordMineCleared() { m_minesCleared++; }
114112

115-
//Returns the natural command center template (you may capture others in a game...)
113+
// Returns the natural command center template (you may capture others in a game...)
116114
const ThingTemplate* getCommandCenterTemplate() const { return m_commandCenterTemplate; }
117115

118-
//Use these functions for the Neutral player only!
116+
// Use these functions for the Neutral player only!
119117
void recordVehicleSniped() { m_vehiclesSniped++; }
120118
UnsignedInt getVehiclesSniped() const { return m_vehiclesSniped; }
121119
void recordMine() { m_mines++; }
122120
UnsignedInt getMines() const { return m_mines; }
123121

124-
const Player *getPlayer() { return m_player; }
122+
const Player* getPlayer() { return m_player; }
125123
Bool hadASupplyCenter() const { return m_supplyCentersBuilt > 0; }
126124

127-
Bool calculateAcademyAdvice( AcademyAdviceInfo *info );
125+
Bool calculateAcademyAdvice(AcademyAdviceInfo* info);
128126

129127
protected:
130128
// snapshot methods
131-
virtual void crc( Xfer *xfer ) override;
132-
virtual void xfer( Xfer *xfer ) override;
129+
virtual void crc(Xfer* xfer) override;
130+
virtual void xfer(Xfer* xfer) override;
133131
virtual void loadPostProcess() override;
134132

135133
private:
134+
void evaluateTier1Advice(AcademyAdviceInfo* info, Int numAvailableTips = -1);
135+
void evaluateTier2Advice(AcademyAdviceInfo* info, Int numAvailableTips = -1);
136+
void evaluateTier3Advice(AcademyAdviceInfo* info, Int numAvailableTips = -1);
136137

137-
void evaluateTier1Advice( AcademyAdviceInfo *info, Int numAvailableTips = -1 );
138-
void evaluateTier2Advice( AcademyAdviceInfo *info, Int numAvailableTips = -1 );
139-
void evaluateTier3Advice( AcademyAdviceInfo *info, Int numAvailableTips = -1 );
140-
141-
const Player *m_player;
138+
const Player* m_player;
142139
UnsignedInt m_nextUpdateFrame;
143140
Bool m_firstUpdate;
144-
const CommandSet *m_dozerCommandSet;
141+
const CommandSet* m_dozerCommandSet;
145142
Bool m_unknownSide;
146-
const ThingTemplate *m_commandCenterTemplate;
143+
const ThingTemplate* m_commandCenterTemplate;
147144

148145
//+-----------------------+
149146
//| Tier 1 (Basic advice) |
150147
//+-----------------------+
151148

152-
//1) Did player build at least one of each structure type available?
153-
//CUT!!!
149+
// 1) Did player build at least one of each structure type available?
150+
// CUT!!!
154151

155-
//2) Did player run out of money before building a supply center?
152+
// 2) Did player run out of money before building a supply center?
156153
Bool m_spentCashBeforeBuildingSupplyCenter;
157154
UnsignedInt m_supplyCentersBuilt;
158-
const ThingTemplate *m_supplyCenterTemplate;
155+
const ThingTemplate* m_supplyCenterTemplate;
159156
UnsignedInt m_supplyCenterCost;
160157

161-
//3) Did player build radar (if applicable)?
158+
// 3) Did player build radar (if applicable)?
162159
Bool m_researchedRadar;
163160

164-
//4) Did player build any dozers/workers?
161+
// 4) Did player build any dozers/workers?
165162
UnsignedInt m_peonsBuilt;
166163

167-
//5) Did player ever capture a structure?
164+
// 5) Did player ever capture a structure?
168165
UnsignedInt m_structuresCaptured;
169166

170-
//6) Did player spend any generals points?
167+
// 6) Did player spend any generals points?
171168
UnsignedInt m_generalsPointsSpent;
172169

173-
//7) Did player ever use a generals power or superweapon?
170+
// 7) Did player ever use a generals power or superweapon?
174171
UnsignedInt m_specialPowersUsed;
175172

176-
//8) Did player garrison any structures?
173+
// 8) Did player garrison any structures?
177174
UnsignedInt m_structuresGarrisoned;
178175

179-
//9) How idle was the player in building military units?
176+
// 9) How idle was the player in building military units?
180177
UnsignedInt m_idleBuildingUnitsMaxFrames;
181178
UnsignedInt m_lastUnitBuiltFrame;
182179

183-
//10) Did player drag select units?
180+
// 10) Did player drag select units?
184181
UnsignedInt m_dragSelectUnits;
185182

186-
//11) Did player upgrade anything?
183+
// 11) Did player upgrade anything?
187184
UnsignedInt m_upgradesPurchased;
188185

189-
//12) Was player out of power for more than 10 minutes?
186+
// 12) Was player out of power for more than 10 minutes?
190187
UnsignedInt m_powerOutMaxFrames;
191188
UnsignedInt m_oldestPowerOutFrame;
192-
Bool m_hadPowerLastCheck;
189+
Bool m_hadPowerLastCheck;
193190

194-
//13) Extra gathers built?
191+
// 13) Extra gathers built?
195192
UnsignedInt m_gatherersBuilt;
196193

197-
//14) Heroes built?
194+
// 14) Heroes built?
198195
UnsignedInt m_heroesBuilt;
199196

200197
//+------------------------------+
201198
//| Tier 2 (Intermediate advice) |
202199
//+------------------------------+
203200

204-
//15) Selected a strategy center battle plan?
201+
// 15) Selected a strategy center battle plan?
205202
Bool m_hadAStrategyCenter;
206203
Bool m_choseAStrategyForCenter;
207204

208-
//16) Placed units inside tunnel network?
205+
// 16) Placed units inside tunnel network?
209206
UnsignedInt m_unitsEnteredTunnelNetwork;
210207
Bool m_hadATunnelNetwork;
211208

212-
//17) Player used control groups?
209+
// 17) Player used control groups?
213210
UnsignedInt m_controlGroupsUsed;
214211

215-
//18) Built secondary income unit (hacker, dropzone, blackmarket)?
212+
// 18) Built secondary income unit (hacker, dropzone, blackmarket)?
216213
UnsignedInt m_secondaryIncomeUnitsBuilt;
217214

218-
//19) Cleared out garrisoned buildings?
215+
// 19) Cleared out garrisoned buildings?
219216
UnsignedInt m_clearedGarrisonedBuildings;
220217

221-
//20) Did the Player pick up salvage (as GLA)?
218+
// 20) Did the Player pick up salvage (as GLA)?
222219
UnsignedInt m_salvageCollected;
223220

224-
//21) Did the player ever use the "Guard" ability?
221+
// 21) Did the player ever use the "Guard" ability?
225222
UnsignedInt m_guardAbilityUsedCount;
226223

227-
//22) Did the player build more than one Supply Center (that is, did he expand out)?
228-
//Uses m_supplyCentersBuilt!
224+
// 22) Did the player build more than one Supply Center (that is, did he expand out)?
225+
// Uses m_supplyCentersBuilt!
229226

230-
//23) Did the player ever garrison a vehicle?
231-
//CUT!!!
227+
// 23) Did the player ever garrison a vehicle?
228+
// CUT!!!
232229

233-
//24) Did the player ever use the hotkey to grab all of one unit type (change to use any hotkeys)?
234-
//CUT!!!
230+
// 24) Did the player ever use the hotkey to grab all of one unit type (change to use any hotkeys)?
231+
// CUT!!!
235232

236233
//+--------------------------+
237234
//| Tier 3 (Advanced advice) |
238235
//+--------------------------+
239236

240-
//25) Did the player use the new alternate interface in the options?
241-
//Uses TheGlobalData->m_useAlternateMouse
237+
// 25) Did the player use the new alternate interface in the options?
238+
// Uses TheGlobalData->m_useAlternateMouse
242239

243-
//26) Player did not use the new "double click location attack move/guard"
240+
// 26) Player did not use the new "double click location attack move/guard"
244241
UnsignedInt m_doubleClickAttackMoveOrdersGiven;
245242

246-
//27) Built barracks within 5 minutes?
243+
// 27) Built barracks within 5 minutes?
247244
Bool m_builtBarracksWithinFiveMinutes;
248245

249-
//28) Built war factory within 10 minutes?
246+
// 28) Built war factory within 10 minutes?
250247
Bool m_builtWarFactoryWithinTenMinutes;
251248

252-
//29) Built tech structure within 15 minutes?
249+
// 29) Built tech structure within 15 minutes?
253250
Bool m_builtTechStructureWithinFifteenMinutes;
254251

255-
//30) No income for 2 minutes?
252+
// 30) No income for 2 minutes?
256253
UnsignedInt m_lastIncomeFrame;
257254
UnsignedInt m_maxFramesBetweenIncome;
258255

259-
//31) Did the Player ever use Dozers/Workers to clear out traps/mines/booby traps?
260-
UnsignedInt m_mines; //Neutral player stat
256+
// 31) Did the Player ever use Dozers/Workers to clear out traps/mines/booby traps?
257+
UnsignedInt m_mines; // Neutral player stat
261258
UnsignedInt m_minesCleared;
262259

263-
//32) Captured any sniped vehicles?
260+
// 32) Captured any sniped vehicles?
264261
UnsignedInt m_vehiclesRecovered;
265262
UnsignedInt m_vehiclesSniped;
266263

267-
//33) Did the player ever build a "disguisable" unit and never used the disguise ability?
264+
// 33) Did the player ever build a "disguisable" unit and never used the disguise ability?
268265
UnsignedInt m_disguisableVehiclesBuilt;
269266
UnsignedInt m_vehiclesDisguised;
270267

271-
//34) Did the player never build a "stealth" upgrade?
272-
//CUT!!!
268+
// 34) Did the player never build a "stealth" upgrade?
269+
// CUT!!!
273270

274-
//35) Did the player ever create a "Firestorm" with his MiGs or Inferno Cannons?
271+
// 35) Did the player ever create a "Firestorm" with his MiGs or Inferno Cannons?
275272
UnsignedInt m_firestormsCreated;
276273
};

Core/GameEngine/Include/Common/AddonCompat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ namespace addon
2222
{
2323
extern Bool HasFullviewportDat();
2424

25-
} // namespace addon
25+
} // namespace addon

0 commit comments

Comments
 (0)