diff --git a/CHANGELOG.md b/CHANGELOG.md index 641471455f..ded0dd9ba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -103,6 +103,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - New `SceneMan` function `CastAllMOsRay(startVector, rayVector, table ignoreMOIDs, ignoreTeam, ignoreMaterial, bool ignoreAllTerrain, int skip)` which returns an iterator with pointers to all the non-ignored MOs met along the ray. +- Added scaling capability to Bitmap primitives. + New draw bindings with argument for scale are: + ``` + PrimitiveMan:DrawBitmapPrimitive(pos, moSprite, rotAngle, frame, scale) + PrimitiveMan:DrawBitmapPrimitive(pos, moSprite, rotAngle, frame, scale, bool hFlipped, bool vFlipped) + PrimitiveMan:DrawBitmapPrimitive(player, pos, moSprite, rotAngle, frame, scale) + PrimitiveMan:DrawBitmapPrimitive(player, pos, moSprite, rotAngle, frame, scale, bool hFlipped, bool vFlipped) + PrimitiveMan:DrawBitmapPrimitive(pos, filePath, rotAngle, scale) + PrimitiveMan:DrawBitmapPrimitive(pos, filePath, rotAngle, scale, bool hFlipped, bool vFlipped) + PrimitiveMan:DrawBitmapPrimitive(player, pos, filePath, rotAngle, scale) + PrimitiveMan:DrawBitmapPrimitive(player, pos, filePath, rotAngle, scale, bool hFlipped, bool vFlipped) + ``` + As well as constructors: + ``` + BitmapPrimitive(player, pos, moSprite, rotAngle, frame, scale, hFlipped, vFlipped) + BitmapPrimitive(player, pos, filePath, rotAngle, scale, hFlipped, vFlipped) + ``` + Original bindings with no scale argument are untouched and can be called as they were. +
Changed diff --git a/Source/Lua/LuaBindingsManagers.cpp b/Source/Lua/LuaBindingsManagers.cpp index 24470d05ca..37be7b48a6 100644 --- a/Source/Lua/LuaBindingsManagers.cpp +++ b/Source/Lua/LuaBindingsManagers.cpp @@ -262,13 +262,21 @@ LuaBindingRegisterFunctionDefinitionForType(ManagerLuaBindings, PrimitiveMan) { .def("DrawTextPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& text, bool isSmall, int alignment)) & PrimitiveMan::DrawTextPrimitive) .def("DrawTextPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& text, bool isSmall, int alignment, float rotAngle)) & PrimitiveMan::DrawTextPrimitive) .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame)) & PrimitiveMan::DrawBitmapPrimitive) + .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame, float scale)) & PrimitiveMan::DrawBitmapPrimitive) .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive) + .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame, float scale, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive) .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame)) & PrimitiveMan::DrawBitmapPrimitive) + .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame, float scale)) & PrimitiveMan::DrawBitmapPrimitive) .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive) + .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const MOSprite* moSprite, float rotAngle, unsigned int frame, float scale, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive) .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const std::string& filePath, float rotAngle)) & PrimitiveMan::DrawBitmapPrimitive) + .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const std::string& filePath, float rotAngle, float scale)) & PrimitiveMan::DrawBitmapPrimitive) .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const std::string& filePath, float rotAngle, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive) + .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(const Vector& start, const std::string& filePath, float rotAngle, float scale, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive) .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& filePath, float rotAngle)) & PrimitiveMan::DrawBitmapPrimitive) + .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& filePath, float rotAngle, float scale)) & PrimitiveMan::DrawBitmapPrimitive) .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& filePath, float rotAngle, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive) + .def("DrawBitmapPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, const std::string& filePath, float rotAngle, float scale, bool hFlipped, bool vFlipped)) & PrimitiveMan::DrawBitmapPrimitive) .def("DrawIconPrimitive", (void(PrimitiveMan::*)(const Vector& start, Entity* entity)) & PrimitiveMan::DrawIconPrimitive) .def("DrawIconPrimitive", (void(PrimitiveMan::*)(int player, const Vector& start, Entity* entity)) & PrimitiveMan::DrawIconPrimitive) diff --git a/Source/Lua/LuaBindingsPrimitives.cpp b/Source/Lua/LuaBindingsPrimitives.cpp index 65d932888b..3122129a26 100644 --- a/Source/Lua/LuaBindingsPrimitives.cpp +++ b/Source/Lua/LuaBindingsPrimitives.cpp @@ -95,6 +95,8 @@ LuaBindingRegisterFunctionDefinitionForType(PrimitiveLuaBindings, TextPrimitive) LuaBindingRegisterFunctionDefinitionForType(PrimitiveLuaBindings, BitmapPrimitive) { return luabind::class_("BitmapPrimitive") + .def(luabind::constructor()) + .def(luabind::constructor()) .def(luabind::constructor()) .def(luabind::constructor()); } diff --git a/Source/Managers/PrimitiveMan.cpp b/Source/Managers/PrimitiveMan.cpp index 8e007a6517..7b3df14769 100644 --- a/Source/Managers/PrimitiveMan.cpp +++ b/Source/Managers/PrimitiveMan.cpp @@ -217,12 +217,12 @@ void PrimitiveMan::DrawTextPrimitive(int player, const Vector& start, const std: SchedulePrimitive(std::make_unique(player, start, text, isSmall, alignment, rotAngle)); } -void PrimitiveMan::DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped) { - SchedulePrimitive(std::make_unique(player, centerPos, moSprite, rotAngle, frame, hFlipped, vFlipped)); +void PrimitiveMan::DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, float scale, bool hFlipped, bool vFlipped) { + SchedulePrimitive(std::make_unique(player, centerPos, moSprite, rotAngle, frame, scale, hFlipped, vFlipped)); } -void PrimitiveMan::DrawBitmapPrimitive(int player, const Vector& centerPos, const std::string& filePath, float rotAngle, bool hFlipped, bool vFlipped) { - SchedulePrimitive(std::make_unique(player, centerPos, filePath, rotAngle, hFlipped, vFlipped)); +void PrimitiveMan::DrawBitmapPrimitive(int player, const Vector& centerPos, const std::string& filePath, float rotAngle, float scale, bool hFlipped, bool vFlipped) { + SchedulePrimitive(std::make_unique(player, centerPos, filePath, rotAngle, scale, hFlipped, vFlipped)); } void PrimitiveMan::DrawIconPrimitive(int player, const Vector& centerPos, Entity* entity) { diff --git a/Source/Managers/PrimitiveMan.h b/Source/Managers/PrimitiveMan.h index e920a091bf..3bfa9dc48d 100644 --- a/Source/Managers/PrimitiveMan.h +++ b/Source/Managers/PrimitiveMan.h @@ -311,6 +311,14 @@ namespace RTE { /// @param frame Frame to draw. void DrawBitmapPrimitive(const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame) { DrawBitmapPrimitive(-1, centerPos, moSprite, rotAngle, frame, false, false); } + /// Schedule to draw a bitmap primitive. + /// @param centerPos Position of primitive's center in scene coordinates. + /// @param moSprite A MOSprite to draw BITMAP from. + /// @param rotAngle Rotation angle in radians. + /// @param frame Frame to draw. + /// @param scale Drawing scale. + void DrawBitmapPrimitive(const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, float scale) { DrawBitmapPrimitive(-1, centerPos, moSprite, rotAngle, scale, frame, false, false); } + /// Schedule to draw a bitmap primitive with the option to flip the primitive horizontally and vertically. /// @param centerPos Position of primitive's center in scene coordinates. /// @param moSprite A MOSprite to draw BITMAP from. @@ -320,6 +328,16 @@ namespace RTE { /// @param vFlipped Whether to flip the sprite vertically. 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); } + /// Schedule to draw a bitmap primitive with the option to flip the primitive horizontally and vertically. + /// @param centerPos Position of primitive's center in scene coordinates. + /// @param moSprite A MOSprite to draw BITMAP from. + /// @param rotAngle Rotation angle in radians. + /// @param frame Frame to draw. + /// @param scale Drawing scale. + /// @param hFlipped Whether to flip the sprite horizontally. + /// @param vFlipped Whether to flip the sprite vertically. + void DrawBitmapPrimitive(const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, float scale, bool hFlipped, bool vFlipped) { DrawBitmapPrimitive(-1, centerPos, moSprite, rotAngle, frame, scale, hFlipped, vFlipped); } + /// Schedule to draw a bitmap primitive visible only to a specified player. /// @param player Player screen to draw primitive on. /// @param centerPos Position of primitive's center in scene coordinates. @@ -328,15 +346,35 @@ namespace RTE { /// @param frame Frame to draw. void DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame) { DrawBitmapPrimitive(player, centerPos, moSprite, rotAngle, frame, false, false); } + /// Schedule to draw a bitmap primitive visible only to a specified player. + /// @param player Player screen to draw primitive on. + /// @param centerPos Position of primitive's center in scene coordinates. + /// @param moSprite A MOSprite to draw BITMAP from. + /// @param rotAngle Rotation angle in radians. + /// @param frame Frame to draw. + /// @param scale Drawing scale. + void DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, float scale) { DrawBitmapPrimitive(player, centerPos, moSprite, rotAngle, frame, scale, false, false); } + + /// Schedule to draw a bitmap primitive visible only to a specified player with the option to flip the primitive horizontally or vertically. + /// @param player Player screen to draw primitive on. + /// @param centerPos Position of primitive's center in scene coordinates. + /// @param moSprite A MOSprite to draw BITMAP from. + /// @param rotAngle Rotation angle in radians. + /// @param frame Frame to draw. + /// @param hFlipped Whether to flip the sprite horizontally. + /// @param vFlipped Whether to flip the sprite vertically. + void DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped) { DrawBitmapPrimitive(player, centerPos, moSprite, rotAngle, frame, 1.0f, false, false); } + /// Schedule to draw a bitmap primitive visible only to a specified player with the option to flip the primitive horizontally or vertically. /// @param player Player screen to draw primitive on. /// @param centerPos Position of primitive's center in scene coordinates. /// @param moSprite A MOSprite to draw BITMAP from. /// @param rotAngle Rotation angle in radians. /// @param frame Frame to draw. + /// @param scale Drawing scale. /// @param hFlipped Whether to flip the sprite horizontally. /// @param vFlipped Whether to flip the sprite vertically. - void DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped); + void DrawBitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, float scale, bool hFlipped, bool vFlipped); /// Schedule to draw a bitmap primitive. /// @param centerPos Position of primitive's center in scene coordinates. @@ -344,6 +382,13 @@ namespace RTE { /// @param rotAngle Rotation angle in radians. void DrawBitmapPrimitive(const Vector& centerPos, const std::string& filePath, float rotAngle) { DrawBitmapPrimitive(-1, centerPos, filePath, rotAngle, false, false); } + /// Schedule to draw a bitmap primitive. + /// @param centerPos Position of primitive's center in scene coordinates. + /// @param filePath Path to the bitmap to draw. + /// @param rotAngle Rotation angle in radians. + /// @param scale Drawing scale. + void DrawBitmapPrimitive(const Vector& centerPos, const std::string& filePath, float rotAngle, float scale) { DrawBitmapPrimitive(-1, centerPos, filePath, rotAngle, scale, false, false); } + /// Schedule to draw a bitmap primitive with the option to flip the primitive horizontally and vertically. /// @param centerPos Position of primitive's center in scene coordinates. /// @param filePath An entity to draw sprite from. @@ -352,6 +397,15 @@ namespace RTE { /// @param vFlipped Whether to flip the sprite vertically. void DrawBitmapPrimitive(const Vector& centerPos, const std::string& filePath, float rotAngle, bool hFlipped, bool vFlipped) { DrawBitmapPrimitive(-1, centerPos, filePath, rotAngle, hFlipped, vFlipped); } + /// Schedule to draw a bitmap primitive with the option to flip the primitive horizontally and vertically. + /// @param centerPos Position of primitive's center in scene coordinates. + /// @param filePath An entity to draw sprite from. + /// @param rotAngle Rotation angle in radians. + /// @param scale Drawing scale. + /// @param hFlipped Whether to flip the sprite horizontally. + /// @param vFlipped Whether to flip the sprite vertically. + void DrawBitmapPrimitive(const Vector& centerPos, const std::string& filePath, float rotAngle, float scale, bool hFlipped, bool vFlipped) { DrawBitmapPrimitive(-1, centerPos, filePath, rotAngle, scale, hFlipped, vFlipped); } + /// Schedule to draw a bitmap primitive visible only to a specified player. /// @param player Player screen to draw primitive on. /// @param centerPos Position of primitive's center in scene coordinates. @@ -359,14 +413,32 @@ namespace RTE { /// @param rotAngle Rotation angle in radians. void DrawBitmapPrimitive(int player, const Vector& centerPos, const std::string& filePath, float rotAngle) { DrawBitmapPrimitive(player, centerPos, filePath, rotAngle, false, false); } + /// Schedule to draw a bitmap primitive visible only to a specified player. + /// @param player Player screen to draw primitive on. + /// @param centerPos Position of primitive's center in scene coordinates. + /// @param filePath Path to the bitmap to draw. + /// @param rotAngle Rotation angle in radians. + /// @param scale Drawing scale. + void DrawBitmapPrimitive(int player, const Vector& centerPos, const std::string& filePath, float rotAngle, float scale) { DrawBitmapPrimitive(player, centerPos, filePath, rotAngle, scale, false, false); } + + /// Schedule to draw a bitmap primitive visible only to a specified player with the option to flip the primitive horizontally or vertically. + /// @param player Player screen to draw primitive on. + /// @param centerPos Position of primitive's center in scene coordinates. + /// @param filePath Path to the bitmap to draw. + /// @param rotAngle Rotation angle in radians. + /// @param hFlipped Whether to flip the sprite horizontally. + /// @param vFlipped Whether to flip the sprite vertically. + void DrawBitmapPrimitive(int player, const Vector& centerPos, const std::string& filePath, float rotAngle, bool hFlipped, bool vFlipped) { DrawBitmapPrimitive(player, centerPos, filePath, rotAngle, 1.0f, false, false); } + /// Schedule to draw a bitmap primitive visible only to a specified player with the option to flip the primitive horizontally or vertically. /// @param player Player screen to draw primitive on. /// @param centerPos Position of primitive's center in scene coordinates. /// @param filePath Path to the bitmap to draw. /// @param rotAngle Rotation angle in radians. + /// @param scale Drawing scale. /// @param hFlipped Whether to flip the sprite horizontally. /// @param vFlipped Whether to flip the sprite vertically. - void DrawBitmapPrimitive(int player, const Vector& centerPos, const std::string& filePath, float rotAngle, bool hFlipped, bool vFlipped); + void DrawBitmapPrimitive(int player, const Vector& centerPos, const std::string& filePath, float rotAngle, float scale, bool hFlipped, bool vFlipped); /// Schedule to draw the GUI icon of an object. /// @param centerPos Position of primitive's center in scene coordinates. diff --git a/Source/System/GraphicalPrimitive.cpp b/Source/System/GraphicalPrimitive.cpp index 7cb922151b..6f19674485 100644 --- a/Source/System/GraphicalPrimitive.cpp +++ b/Source/System/GraphicalPrimitive.cpp @@ -504,9 +504,13 @@ void BitmapPrimitive::Draw(BITMAP* drawScreen, const Vector& targetPos) { return; } - BITMAP* bitmapToDraw = create_bitmap_ex(8, m_Bitmap->w, m_Bitmap->h); + BITMAP* bitmapToDraw = create_bitmap_ex(8, m_Bitmap->w * m_Scale, m_Bitmap->h * m_Scale); clear_to_color(bitmapToDraw, ColorKeys::g_MaskColor); - draw_sprite(bitmapToDraw, m_Bitmap, 0, 0); + if (m_Scale == 1.0f) { + draw_sprite(bitmapToDraw, m_Bitmap, 0, 0); + } else { + stretch_sprite(bitmapToDraw, m_Bitmap, 0, 0, m_Bitmap->w * m_Scale, m_Bitmap->h * m_Scale); + } if (m_HFlipped || m_VFlipped) { BITMAP* flipBitmap = create_bitmap_ex(8, bitmapToDraw->w, bitmapToDraw->h); diff --git a/Source/System/GraphicalPrimitive.h b/Source/System/GraphicalPrimitive.h index f074a86a10..93c40ae08c 100644 --- a/Source/System/GraphicalPrimitive.h +++ b/Source/System/GraphicalPrimitive.h @@ -537,49 +537,86 @@ namespace RTE { float m_RotAngle = 0; //!< Angle to rotate bitmap in radians. bool m_HFlipped = false; //!< Whether the Bitmap to draw should be horizontally flipped. bool m_VFlipped = false; //!< Whether the Bitmap to draw should be vertically flipped. + float m_Scale = 1.0f; /// Constructor method for BitmapPrimitive object. /// @param player Player screen to draw this primitive on. /// @param centerPos Position of this primitive's center. /// @param bitmap BITMAP to draw. /// @param rotAngle Angle to rotate BITMAP in radians. + /// @param scale BITMAP scale. /// @param hFlipped Whether the BITMAP to draw should be horizontally flipped. /// @param vFlipped Whether the BITMAP to draw should be vertically flipped. - BitmapPrimitive(int player, const Vector& centerPos, BITMAP* bitmap, float rotAngle, bool hFlipped, bool vFlipped) : + BitmapPrimitive(int player, const Vector& centerPos, BITMAP* bitmap, float rotAngle, float scale, bool hFlipped, bool vFlipped) : m_Bitmap(bitmap), m_RotAngle(rotAngle), m_HFlipped(hFlipped), m_VFlipped(vFlipped) { m_StartPos = centerPos; m_Player = player; + m_Scale = scale; } + /// Constructor method for BitmapPrimitive object. + /// @param player Player screen to draw this primitive on. + /// @param centerPos Position of this primitive's center. + /// @param bitmap BITMAP to draw. + /// @param rotAngle Angle to rotate BITMAP in radians. + /// @param hFlipped Whether the BITMAP to draw should be horizontally flipped. + /// @param vFlipped Whether the BITMAP to draw should be vertically flipped. + BitmapPrimitive(int player, const Vector& centerPos, BITMAP* bitmap, float rotAngle, bool hFlipped, bool vFlipped) : + BitmapPrimitive(player, centerPos, bitmap, rotAngle, 1.0f, hFlipped, vFlipped) {} + /// Constructor method for BitmapPrimitive object. /// @param player Player screen to draw this primitive on. /// @param centerPos Position of this primitive's center. /// @param moSprite The MOSprite to get the BITMAP to draw from. /// @param rotAngle Angle to rotate BITMAP in radians. /// @param frame Frame number of the MOSprite that will be drawn. + /// @param scale BITMAP scale. /// @param hFlipped Whether the BITMAP to draw should be horizontally flipped. /// @param vFlipped Whether the BITMAP to draw should be vertically flipped. - BitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped) : + BitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, float scale, bool hFlipped, bool vFlipped) : m_Bitmap(moSprite->GetSpriteFrame(frame)), m_RotAngle(rotAngle), m_HFlipped(hFlipped), m_VFlipped(vFlipped) { m_StartPos = centerPos; m_Player = player; + m_Scale = scale; } + /// Constructor method for BitmapPrimitive object. + /// @param player Player screen to draw this primitive on. + /// @param centerPos Position of this primitive's center. + /// @param moSprite The MOSprite to get the BITMAP to draw from. + /// @param rotAngle Angle to rotate BITMAP in radians. + /// @param frame Frame number of the MOSprite that will be drawn. + /// @param hFlipped Whether the BITMAP to draw should be horizontally flipped. + /// @param vFlipped Whether the BITMAP to draw should be vertically flipped. + BitmapPrimitive(int player, const Vector& centerPos, const MOSprite* moSprite, float rotAngle, unsigned int frame, bool hFlipped, bool vFlipped) : + BitmapPrimitive(player, centerPos, moSprite, rotAngle, frame, 1.0f, hFlipped, vFlipped) {} + /// Constructor method for BitmapPrimitive object. /// @param player Player screen to draw this primitive on. /// @param centerPos Position of this primitive's center. /// @param filePath The path to get the BITMAP to draw from. /// @param rotAngle Angle to rotate BITMAP in radians. + /// @param scale BITMAP scale. /// @param hFlipped Whether the BITMAP to draw should be horizontally flipped. /// @param vFlipped Whether the BITMAP to draw should be vertically flipped. - BitmapPrimitive(int player, const Vector& centerPos, const std::string& filePath, float rotAngle, bool hFlipped, bool vFlipped) : + BitmapPrimitive(int player, const Vector& centerPos, const std::string& filePath, float rotAngle, float scale, bool hFlipped, bool vFlipped) : m_Bitmap(ContentFile(filePath.c_str()).GetAsBitmap()), m_RotAngle(rotAngle), m_HFlipped(hFlipped), m_VFlipped(vFlipped) { m_StartPos = centerPos; m_Player = player; + m_Scale = scale; } + /// Constructor method for BitmapPrimitive object. + /// @param player Player screen to draw this primitive on. + /// @param centerPos Position of this primitive's center. + /// @param filePath The path to get the BITMAP to draw from. + /// @param rotAngle Angle to rotate BITMAP in radians. + /// @param hFlipped Whether the BITMAP to draw should be horizontally flipped. + /// @param vFlipped Whether the BITMAP to draw should be vertically flipped. + BitmapPrimitive(int player, const Vector& centerPos, const std::string& filePath, float rotAngle, bool hFlipped, bool vFlipped) : + BitmapPrimitive(player, centerPos, filePath, rotAngle, 1.0f, hFlipped, vFlipped) {} private: static const PrimitiveType c_PrimitiveType; //!< Type identifier of this primitive.