Skip to content

Commit 0aa55f1

Browse files
committed
Merge branch 'development' into recompilation-speed
2 parents 6f36acd + 02b3f85 commit 0aa55f1

19 files changed

+114
-61
lines changed

.git-blame-ignore-revs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
27d409a89cb1607321404e0ebfe8bc0a63c337a3
2+
c80a961e5f0239a38b788ce86853bb79ed4e8651
3+
d5d14f26509c93046cf0a5237240d7424cd4e9a8
4+
18842d873018583c779d3c423fc1fe6f374b8f66
5+
be2baf37135bbfd93bb8d90d765a66141ad2ab6e
6+
dde53bfe198efcc04f55e1763fbe581115a618bd
7+
6d4b989edd3b15571fb33ee36ca5be60b034719d
8+
522463495db6a2943e7c9ace70e8102588ef3528
9+
b22c5ab241f040a16ef502a8b5f2bca125368060
10+
6ea2d54ba223da8f56a52f1f0346aff892e4a0ba
11+
71454b967661e51d6998ea95db9a46df158d87cd
12+
6c5b6167e266685e624153a4eb3794f83c34e62c
13+
f701bc23cfae7c1cafc48070d986ba16a5873416
14+
5efd90188ede818ed42fee06bb65f29cb892c54f
15+
b21b546e2dc9062b1918e7e01d517a537437bbc4

.github/scripts/add-eol.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
sed -e '$a\' "$@"

.github/workflows/clang-format.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,42 @@ jobs:
3535

3636
- name: Run clang-format
3737
run: |
38-
.github/scripts/run-clang-format.py -r Source Data/Base.rte/Shaders \
38+
.github/scripts/run-clang-format.py \
39+
-i \
40+
-r Source Data/Base.rte/Shaders \
3941
--exclude Source/System/Base64 \
4042
--exclude Source/System/BitMask \
4143
--exclude Source/System/glad \
4244
--exclude Source/System/MicroPather \
4345
--exclude Source/System/Semver200 \
4446
--exclude Source/System/StackWalker
47+
- name: Add missing newlines
48+
run: |
49+
.github/scripts/run-clang-format.py \
50+
-i --clang-format-executable .github/scripts/add-eol.sh \
51+
-r Source Data/Base.rte/Shaders \
52+
--exclude Source/System/Base64 \
53+
--exclude Source/System/BitMask \
54+
--exclude Source/System/glad \
55+
--exclude Source/System/MicroPather \
56+
--exclude Source/System/Semver200 \
57+
--exclude Source/System/StackWalker
58+
- name: Report changes
59+
run: |
60+
# Store the changes in a patch file first
61+
git diff > clang-format-changes.patch
62+
# if any changes were made, fail the build
63+
if ! git diff --quiet ; then
64+
echo "::error::Code misformatted. Run clang-format or apply the patch (printed below and attached to job summary) to fix."
65+
# Print the changes to the console
66+
cat clang-format-changes.patch
67+
exit 1
68+
fi
69+
- name: Upload artifacts
70+
uses: actions/upload-artifact@v4
71+
# Only upload the patch file if the build failed, meaning that the code was not properly formatted
72+
if: failure()
73+
with:
74+
name: clang-format-changes.patch
75+
path: |
76+
clang-format-changes.patch

Source/Activities/GATutorial.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ namespace RTE {
185185
// If teh screen has just changed and needs to be redrawn
186186
bool m_ScreenChange;
187187
// Which tutorial step of the current area currently being played back
188-
int m_CurrentStep;
188+
unsigned int m_CurrentStep;
189189
// Which frame of the current step's animation are we on?
190190
int m_CurrentFrame;
191191
// Current room
192192
TutorialRoom m_CurrentRoom;
193193
// Trigger box for the subsequent fight
194194
Box m_FightTriggers[FIGHTSTAGECOUNT];
195-
int m_EnemyCount; //!< The amount of enemy actors at the start of the activity.
195+
unsigned int m_EnemyCount; //!< The amount of enemy actors at the start of the activity.
196196
// The current fight stage
197197
FightStage m_CurrentFightStage;
198198
// The CPU opponent brain; not owned!

Source/Activities/MultiplayerServerLobby.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,18 +808,20 @@ namespace RTE {
808808
}
809809

810810
// Now set the selected tech's module index as what the metaplayer is going to use
811-
if (pTechItem)
811+
if (pTechItem) {
812812
if (pTechItem->m_ExtraIndex == -2)
813813
pGameActivity->SetTeamTech(team, "-All-");
814814
else
815815
pGameActivity->SetTeamTech(team, g_PresetMan.GetDataModuleName(pTechItem->m_ExtraIndex));
816+
}
816817
}
817818

818819
// Set up AI skill levels
819-
if (m_apTeamAISkillSlider[team]->IsEnabled())
820+
if (m_apTeamAISkillSlider[team]->IsEnabled()) {
820821
pGameActivity->SetTeamAISkill(team, m_apTeamAISkillSlider[team]->GetValue());
821-
else
822+
} else {
822823
pGameActivity->SetTeamAISkill(team, AISkillSetting::DefaultSkill);
824+
}
823825
}
824826

825827
// Force close all previously opened files

Source/Entities/LimbPath.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,8 @@ namespace RTE {
341341
return prog / m_RegularLength;
342342
}
343343

344-
int LimbPath::GetCurrentSegmentNumber() const {
345-
int progress = 0;
344+
unsigned int LimbPath::GetCurrentSegmentNumber() const {
345+
unsigned int progress = 0;
346346
if (!m_Ended && !IsStaticPoint()) {
347347
for (std::deque<Vector>::const_iterator itr = m_Segments.begin(); itr != m_CurrentSegment; ++itr) {
348348
progress++;

Source/Entities/LimbPath.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ namespace RTE {
9999
/// Gets a pointer to the segment at the given index. Ownership is NOT transferred.
100100
/// @param segmentIndex The index of the segment to get.
101101
/// @return A pointer to the segment at the given index. Ownership is NOT transferred.
102-
Vector* GetSegment(int segmentIndex) {
103-
if (segmentIndex >= 0 && segmentIndex < m_Segments.size()) {
102+
Vector* GetSegment(unsigned int segmentIndex) {
103+
if (segmentIndex < m_Segments.size()) {
104104
return &m_Segments.at(segmentIndex);
105105
}
106106
return nullptr;
@@ -219,7 +219,7 @@ namespace RTE {
219219

220220
/// Gets the current segment as a number, rather than an iterator.
221221
/// @return The current segment as a number.
222-
int GetCurrentSegmentNumber() const;
222+
unsigned int GetCurrentSegmentNumber() const;
223223

224224
/// Sets a new array of 'waypoints' or segments of this LimbPath.
225225
/// @param newSpeed An int specifying how many segments there are in the following
@@ -374,7 +374,7 @@ namespace RTE {
374374
// The iterator to the segment of the path that the limb ended up on the end of
375375
std::deque<Vector>::iterator m_CurrentSegment;
376376

377-
int m_FootCollisionsDisabledSegment; //!< The segment after which foot collisions will be disabled for this limbpath, if it's for legs.
377+
unsigned int m_FootCollisionsDisabledSegment; //!< The segment after which foot collisions will be disabled for this limbpath, if it's for legs.
378378

379379
// Normalized measure of how far the limb has progressed toward the
380380
// current segment's target. 0.0 means its farther away than the

Source/Entities/MOSprite.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ namespace RTE {
8888
/// @param whichFrame Which frame to get. (default: 0)
8989
/// @return A pointer to the requested frame of this MOSprite's BITMAP array.
9090
/// Ownership is NOT transferred!
91-
BITMAP* GetSpriteFrame(int whichFrame = 0) const { return (whichFrame >= 0 && whichFrame < m_FrameCount) ? m_aSprite[whichFrame] : 0; }
91+
BITMAP* GetSpriteFrame(unsigned int whichFrame = 0) const { return (whichFrame < m_FrameCount) ? m_aSprite[whichFrame] : 0; }
9292

9393
/// Gets the width of the bitmap of this MOSprite
9494
/// @return Sprite width if loaded.

Source/Entities/MovableObject.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ namespace RTE {
718718
/// Returns force vector in newtons of the specified Force record.
719719
/// @param n Force record index to get data from.
720720
/// @return Force vector in newtons of the specified Force record.
721-
Vector GetForceVector(int n) {
721+
Vector GetForceVector(unsigned int n) {
722722
if (n > 0 && n < m_Forces.size())
723723
return m_Forces[n].first;
724724
else
@@ -732,7 +732,7 @@ namespace RTE {
732732
/// Returns offset vector in METERS (not pixels) of the specified Force record.
733733
/// @param n Force record index to get data from.
734734
/// @return Offset vector in meters of the specified Force record.
735-
Vector GetForceOffset(int n) {
735+
Vector GetForceOffset(unsigned int n) {
736736
if (n > 0 && n < m_Forces.size())
737737
return m_Forces[n].second;
738738
else
@@ -741,14 +741,14 @@ namespace RTE {
741741

742742
/// Sets force vector in newtons of the specified Force record.
743743
/// @param n Force record index to get data from. New Vector force value in newtons.
744-
void SetForceVector(int n, Vector v) {
744+
void SetForceVector(unsigned int n, Vector v) {
745745
if (n > 0 && n < m_Forces.size())
746746
m_Forces[n].first = v;
747747
}
748748

749749
/// Sets offset vector in METERS (not pixels) of the specified Force record.
750750
/// @param n Force record index to get data from. New Vector offset value in meters.
751-
void SetForceOffset(int n, Vector v) {
751+
void SetForceOffset(unsigned int n, Vector v) {
752752
if (n > 0 && n < m_Forces.size())
753753
m_Forces[n].second = v;
754754
}
@@ -764,7 +764,7 @@ namespace RTE {
764764
/// Returns Impulse vector in newtons of the specified Impulse record.
765765
/// @param n Impulse record index to get data from.
766766
/// @return Impulse vector in newtons of the specified Impulse record.
767-
Vector GetImpulseVector(int n) {
767+
Vector GetImpulseVector(unsigned int n) {
768768
if (n > 0 && n < m_ImpulseForces.size())
769769
return m_ImpulseForces[n].first;
770770
else
@@ -774,7 +774,7 @@ namespace RTE {
774774
/// Returns offset vector in METERS (not pixels) of the specified Impulse record.
775775
/// @param n Impulse record index to get data from.
776776
/// @return Offset vector in meters of the specified Impulse record.
777-
Vector GetImpulseOffset(int n) {
777+
Vector GetImpulseOffset(unsigned int n) {
778778
if (n > 0 && n < m_ImpulseForces.size())
779779
return m_ImpulseForces[n].second;
780780
else
@@ -784,14 +784,14 @@ namespace RTE {
784784
/// Returns offset vector in METERS (not pixels) of the specified Impulse record.
785785
/// @param n Impulse record index to get data from.
786786
/// @return Offset vector in meters of the specified Impulse record.
787-
void SetImpulseVector(int n, Vector v) {
787+
void SetImpulseVector(unsigned int n, Vector v) {
788788
if (n > 0 && n < m_ImpulseForces.size())
789789
m_ImpulseForces[n].first = v;
790790
}
791791

792792
/// Sets offset vector in METERS (not pixels) of the specified Impulse record.
793793
/// @param n Impulse record index to get data from. New Vector offset value in meters.
794-
void SetImpulseOffset(int n, Vector v) {
794+
void SetImpulseOffset(unsigned int n, Vector v) {
795795
if (n > 0 && n < m_ImpulseForces.size())
796796
m_ImpulseForces[n].second = v;
797797
}

Source/Lua/LuaBindingsManagers.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ namespace RTE {
243243
.def("DrawTextPrimitive", (void(PrimitiveMan::*)(const Vector& start, const std::string& text, bool isSmall, int alignment, float rotAngle)) & PrimitiveMan::DrawTextPrimitive)
244244
.def("DrawTextPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& text, bool isSmall, int alignment)) & PrimitiveMan::DrawTextPrimitive)
245245
.def("DrawTextPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& text, bool isSmall, int alignment, float rotAngle)) & PrimitiveMan::DrawTextPrimitive)
246-
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, int frame)) & PrimitiveMan::DrawBitmapPrimitive)
247-
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, int frame, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive)
248-
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, int frame)) & PrimitiveMan::DrawBitmapPrimitive)
249-
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, int frame, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive)
246+
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame)) & PrimitiveMan::DrawBitmapPrimitive)
247+
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive)
248+
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame)) & PrimitiveMan::DrawBitmapPrimitive)
249+
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive)
250250
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const std::string& filePath, float rotAngle)) & PrimitiveMan::DrawBitmapPrimitive)
251251
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const std::string& filePath, float rotAngle, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive)
252252
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& filePath, float rotAngle)) & PrimitiveMan::DrawBitmapPrimitive)

0 commit comments

Comments
 (0)