Skip to content

Commit 0389edc

Browse files
committed
Make GetSpriteFrame take uint frame number.
1 parent ed50778 commit 0389edc

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

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/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)

Source/Lua/LuaBindingsPrimitives.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ namespace RTE {
9595
LuaBindingRegisterFunctionDefinitionForType(PrimitiveLuaBindings, BitmapPrimitive) {
9696
return luabind::class_<BitmapPrimitive, GraphicalPrimitive>("BitmapPrimitive")
9797

98-
.def(luabind::constructor<int, const Vector&, const MOSprite*, float, int, bool, bool>())
98+
.def(luabind::constructor<int, const Vector&, const MOSprite*, float, unsigned int, bool, bool>())
9999
.def(luabind::constructor<int, const Vector&, const std::string&, float, bool, bool>());
100100
}
101101
} // namespace RTE

Source/Managers/PrimitiveMan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ namespace RTE {
215215
SchedulePrimitive(std::make_unique<TextPrimitive>(player, start, text, isSmall, alignment, rotAngle));
216216
}
217217

218-
void PrimitiveMan::DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, int frame, bool hFlipped, bool vFlipped) {
218+
void PrimitiveMan::DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped) {
219219
SchedulePrimitive(std::make_unique<BitmapPrimitive>(player, centerPos, moSprite, rotAngle, frame, hFlipped, vFlipped));
220220
}
221221

Source/Managers/PrimitiveMan.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ namespace RTE {
310310
/// @param moSprite A MOSprite to draw BITMAP from.
311311
/// @param rotAngle Rotation angle in radians.
312312
/// @param frame Frame to draw.
313-
void DrawBitmapPrimitive(const Vector& centerPos, const MOSprite* moSprite, float rotAngle, int frame) { DrawBitmapPrimitive(-1, centerPos, moSprite, rotAngle, frame, false, false); }
313+
void DrawBitmapPrimitive(const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame) { DrawBitmapPrimitive(-1, centerPos, moSprite, rotAngle, frame, false, false); }
314314

315315
/// Schedule to draw a bitmap primitive with the option to flip the primitive horizontally and vertically.
316316
/// @param centerPos Position of primitive's center in scene coordinates.
@@ -319,15 +319,15 @@ namespace RTE {
319319
/// @param frame Frame to draw.
320320
/// @param hFlipped Whether to flip the sprite horizontally.
321321
/// @param vFlipped Whether to flip the sprite vertically.
322-
void DrawBitmapPrimitive(const Vector& centerPos, const MOSprite* moSprite, float rotAngle, int frame, bool hFlipped, bool vFlipped) { DrawBitmapPrimitive(-1, centerPos, moSprite, rotAngle, frame, hFlipped, vFlipped); }
322+
void DrawBitmapPrimitive(const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped) { DrawBitmapPrimitive(-1, centerPos, moSprite, rotAngle, frame, hFlipped, vFlipped); }
323323

324324
/// Schedule to draw a bitmap primitive visible only to a specified player.
325325
/// @param player Player screen to draw primitive on.
326326
/// @param centerPos Position of primitive's center in scene coordinates.
327327
/// @param moSprite A MOSprite to draw BITMAP from.
328328
/// @param rotAngle Rotation angle in radians.
329329
/// @param frame Frame to draw.
330-
void DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, int frame) { DrawBitmapPrimitive(player, centerPos, moSprite, rotAngle, frame, false, false); }
330+
void DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame) { DrawBitmapPrimitive(player, centerPos, moSprite, rotAngle, frame, false, false); }
331331

332332
/// Schedule to draw a bitmap primitive visible only to a specified player with the option to flip the primitive horizontally or vertically.
333333
/// @param player Player screen to draw primitive on.
@@ -337,7 +337,7 @@ namespace RTE {
337337
/// @param frame Frame to draw.
338338
/// @param hFlipped Whether to flip the sprite horizontally.
339339
/// @param vFlipped Whether to flip the sprite vertically.
340-
void DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, int frame, bool hFlipped, bool vFlipped);
340+
void DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped);
341341

342342
/// Schedule to draw a bitmap primitive.
343343
/// @param centerPos Position of primitive's center in scene coordinates.

Source/System/GraphicalPrimitive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ namespace RTE {
557557
/// @param frame Frame number of the MOSprite that will be drawn.
558558
/// @param hFlipped Whether the BITMAP to draw should be horizontally flipped.
559559
/// @param vFlipped Whether the BITMAP to draw should be vertically flipped.
560-
BitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, int frame, bool hFlipped, bool vFlipped) :
560+
BitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped) :
561561
m_Bitmap(moSprite->GetSpriteFrame(frame)), m_RotAngle(rotAngle), m_HFlipped(hFlipped), m_VFlipped(vFlipped) {
562562

563563
m_StartPos = centerPos;

0 commit comments

Comments
 (0)