Skip to content

Commit 41b13ff

Browse files
committed
Merge branch 'development' into ModuleMan
2 parents fc209ee + 02b3f85 commit 41b13ff

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
@@ -186,14 +186,14 @@ namespace RTE {
186186
// If teh screen has just changed and needs to be redrawn
187187
bool m_ScreenChange;
188188
// Which tutorial step of the current area currently being played back
189-
int m_CurrentStep;
189+
unsigned int m_CurrentStep;
190190
// Which frame of the current step's animation are we on?
191191
int m_CurrentFrame;
192192
// Current room
193193
TutorialRoom m_CurrentRoom;
194194
// Trigger box for the subsequent fight
195195
Box m_FightTriggers[FIGHTSTAGECOUNT];
196-
int m_EnemyCount; //!< The amount of enemy actors at the start of the activity.
196+
unsigned int m_EnemyCount; //!< The amount of enemy actors at the start of the activity.
197197
// The current fight stage
198198
FightStage m_CurrentFightStage;
199199
// The CPU opponent brain; not owned!

Source/Activities/MultiplayerServerLobby.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,18 +799,20 @@ namespace RTE {
799799
}
800800

801801
// Now set the selected tech's module index as what the metaplayer is going to use
802-
if (pTechItem)
802+
if (pTechItem) {
803803
if (pTechItem->m_ExtraIndex == -2)
804804
pGameActivity->SetTeamTech(team, "-All-");
805805
else
806806
pGameActivity->SetTeamTech(team, g_ModuleMan.GetModuleName(pTechItem->m_ExtraIndex));
807+
}
807808
}
808809

809810
// Set up AI skill levels
810-
if (m_apTeamAISkillSlider[team]->IsEnabled())
811+
if (m_apTeamAISkillSlider[team]->IsEnabled()) {
811812
pGameActivity->SetTeamAISkill(team, m_apTeamAISkillSlider[team]->GetValue());
812-
else
813+
} else {
813814
pGameActivity->SetTeamAISkill(team, AISkillSetting::DefaultSkill);
815+
}
814816
}
815817

816818
// Force close all previously opened files

Source/Entities/LimbPath.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ namespace RTE {
333333
return prog / m_RegularLength;
334334
}
335335

336-
int LimbPath::GetCurrentSegmentNumber() const {
337-
int progress = 0;
336+
unsigned int LimbPath::GetCurrentSegmentNumber() const {
337+
unsigned int progress = 0;
338338
if (!m_Ended && !IsStaticPoint()) {
339339
for (std::deque<Vector>::const_iterator itr = m_Segments.begin(); itr != m_CurrentSegment; ++itr) {
340340
progress++;

Source/Entities/LimbPath.h

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

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

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

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

380380
// Normalized measure of how far the limb has progressed toward the
381381
// 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
@@ -89,7 +89,7 @@ namespace RTE {
8989
/// @param whichFrame Which frame to get. (default: 0)
9090
/// @return A pointer to the requested frame of this MOSprite's BITMAP array.
9191
/// Ownership is NOT transferred!
92-
BITMAP* GetSpriteFrame(int whichFrame = 0) const { return (whichFrame >= 0 && whichFrame < m_FrameCount) ? m_aSprite[whichFrame] : 0; }
92+
BITMAP* GetSpriteFrame(unsigned int whichFrame = 0) const { return (whichFrame < m_FrameCount) ? m_aSprite[whichFrame] : 0; }
9393

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

Source/Entities/MovableObject.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ namespace RTE {
719719
/// Returns force vector in newtons of the specified Force record.
720720
/// @param n Force record index to get data from.
721721
/// @return Force vector in newtons of the specified Force record.
722-
Vector GetForceVector(int n) {
722+
Vector GetForceVector(unsigned int n) {
723723
if (n > 0 && n < m_Forces.size())
724724
return m_Forces[n].first;
725725
else
@@ -733,7 +733,7 @@ namespace RTE {
733733
/// Returns offset vector in METERS (not pixels) of the specified Force record.
734734
/// @param n Force record index to get data from.
735735
/// @return Offset vector in meters of the specified Force record.
736-
Vector GetForceOffset(int n) {
736+
Vector GetForceOffset(unsigned int n) {
737737
if (n > 0 && n < m_Forces.size())
738738
return m_Forces[n].second;
739739
else
@@ -742,14 +742,14 @@ namespace RTE {
742742

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

750750
/// Sets offset vector in METERS (not pixels) of the specified Force record.
751751
/// @param n Force record index to get data from. New Vector offset value in meters.
752-
void SetForceOffset(int n, Vector v) {
752+
void SetForceOffset(unsigned int n, Vector v) {
753753
if (n > 0 && n < m_Forces.size())
754754
m_Forces[n].second = v;
755755
}
@@ -765,7 +765,7 @@ namespace RTE {
765765
/// Returns Impulse vector in newtons of the specified Impulse record.
766766
/// @param n Impulse record index to get data from.
767767
/// @return Impulse vector in newtons of the specified Impulse record.
768-
Vector GetImpulseVector(int n) {
768+
Vector GetImpulseVector(unsigned int n) {
769769
if (n > 0 && n < m_ImpulseForces.size())
770770
return m_ImpulseForces[n].first;
771771
else
@@ -775,7 +775,7 @@ namespace RTE {
775775
/// Returns offset vector in METERS (not pixels) of the specified Impulse record.
776776
/// @param n Impulse record index to get data from.
777777
/// @return Offset vector in meters of the specified Impulse record.
778-
Vector GetImpulseOffset(int n) {
778+
Vector GetImpulseOffset(unsigned int n) {
779779
if (n > 0 && n < m_ImpulseForces.size())
780780
return m_ImpulseForces[n].second;
781781
else
@@ -785,14 +785,14 @@ namespace RTE {
785785
/// Returns offset vector in METERS (not pixels) of the specified Impulse record.
786786
/// @param n Impulse record index to get data from.
787787
/// @return Offset vector in meters of the specified Impulse record.
788-
void SetImpulseVector(int n, Vector v) {
788+
void SetImpulseVector(unsigned int n, Vector v) {
789789
if (n > 0 && n < m_ImpulseForces.size())
790790
m_ImpulseForces[n].first = v;
791791
}
792792

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

Source/Lua/LuaBindingsManagers.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,10 @@ namespace RTE {
247247
.def("DrawTextPrimitive", (void(PrimitiveMan::*)(const Vector& start, const std::string& text, bool isSmall, int alignment, float rotAngle)) & PrimitiveMan::DrawTextPrimitive)
248248
.def("DrawTextPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& text, bool isSmall, int alignment)) & PrimitiveMan::DrawTextPrimitive)
249249
.def("DrawTextPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& text, bool isSmall, int alignment, float rotAngle)) & PrimitiveMan::DrawTextPrimitive)
250-
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, int frame)) & PrimitiveMan::DrawBitmapPrimitive)
251-
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, int frame, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive)
252-
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, int frame)) & PrimitiveMan::DrawBitmapPrimitive)
253-
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, int frame, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive)
250+
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame)) & PrimitiveMan::DrawBitmapPrimitive)
251+
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive)
252+
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame)) & PrimitiveMan::DrawBitmapPrimitive)
253+
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive)
254254
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const std::string& filePath, float rotAngle)) & PrimitiveMan::DrawBitmapPrimitive)
255255
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const std::string& filePath, float rotAngle, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive)
256256
.def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& filePath, float rotAngle)) & PrimitiveMan::DrawBitmapPrimitive)

0 commit comments

Comments
 (0)