diff --git a/include/SFML/Graphics/CircleShape.hpp b/include/SFML/Graphics/CircleShape.hpp index fb181948..681e6610 100644 --- a/include/SFML/Graphics/CircleShape.hpp +++ b/include/SFML/Graphics/CircleShape.hpp @@ -44,16 +44,14 @@ public : //////////////////////////////////////////////////////////// /// \brief Default constructor /// - /// Creates a circle with a radius of 10. + /// \param radius Radius of the circle /// //////////////////////////////////////////////////////////// - CircleShape(); + CircleShape(float radius = 0); //////////////////////////////////////////////////////////// /// \brief Set the radius of the circle /// - /// The default radius of a circle is 10. - /// /// \param radius New radius of the circle /// /// \see GetRadius diff --git a/include/SFML/Graphics/ConvexShape.hpp b/include/SFML/Graphics/ConvexShape.hpp index ac0d5be8..d84bdfaf 100644 --- a/include/SFML/Graphics/ConvexShape.hpp +++ b/include/SFML/Graphics/ConvexShape.hpp @@ -45,16 +45,12 @@ public : //////////////////////////////////////////////////////////// /// \brief Default constructor /// - /// Creates a default triangle, just so that it's not empty. - /// //////////////////////////////////////////////////////////// ConvexShape(); //////////////////////////////////////////////////////////// /// \brief Set the number of points of the polygon /// - /// The default number of points of a polygon is 6. - /// /// \param count New number of points of the polygon /// /// \see GetPointsCount diff --git a/include/SFML/Graphics/RectangleShape.hpp b/include/SFML/Graphics/RectangleShape.hpp index 0e9393f9..907c3a7d 100644 --- a/include/SFML/Graphics/RectangleShape.hpp +++ b/include/SFML/Graphics/RectangleShape.hpp @@ -44,16 +44,14 @@ public : //////////////////////////////////////////////////////////// /// \brief Default constructor /// - /// Creates a 10x10 rectangle. + /// \param size Size of the rectangle /// //////////////////////////////////////////////////////////// - RectangleShape(); + RectangleShape(const Vector2f& size = Vector2f(0, 0)); //////////////////////////////////////////////////////////// /// \brief Set the size of the rectangle /// - /// The default size of a rectangle is 10x10. - /// /// \param size New size of the rectangle /// /// \see GetSize diff --git a/include/SFML/Graphics/StarShape.hpp b/include/SFML/Graphics/StarShape.hpp index c906a5b8..90ef0937 100644 --- a/include/SFML/Graphics/StarShape.hpp +++ b/include/SFML/Graphics/StarShape.hpp @@ -44,16 +44,21 @@ public : //////////////////////////////////////////////////////////// /// \brief Default constructor /// - /// Creates a star with 5 points, an inner radius of 10 and - /// an outer radius of 20. - /// //////////////////////////////////////////////////////////// StarShape(); //////////////////////////////////////////////////////////// - /// \brief Set the inner radius of the star + /// \brief Constructor /// - /// The default inner radius of a star is 10. + /// \param innerRadius Inner radius of the star + /// \param outerRadius Outer radius of the star + /// \param pointsCount Number of points of the star + /// + //////////////////////////////////////////////////////////// + StarShape(float innerRadius, float outerRadius, unsigned int pointsCount); + + //////////////////////////////////////////////////////////// + /// \brief Set the inner radius of the star /// /// \param radius New inner radius of the star /// @@ -75,8 +80,6 @@ public : //////////////////////////////////////////////////////////// /// \brief Set the outer radius of the star /// - /// The default outer radius of a star is 20. - /// /// \param radius New outer radius of the star /// /// \see GetOuterRadius @@ -97,8 +100,6 @@ public : //////////////////////////////////////////////////////////// /// \brief Set the number of points of the star /// - /// The default number of points of a star is 5. - /// /// \param count New number of points of the star /// /// \see GetPointsCount diff --git a/src/SFML/Graphics/CircleShape.cpp b/src/SFML/Graphics/CircleShape.cpp index 86a6a3cb..4830e71f 100644 --- a/src/SFML/Graphics/CircleShape.cpp +++ b/src/SFML/Graphics/CircleShape.cpp @@ -32,9 +32,9 @@ namespace sf { //////////////////////////////////////////////////////////// -CircleShape::CircleShape() : -myRadius(10) +CircleShape::CircleShape(float radius) { + SetRadius(radius); } diff --git a/src/SFML/Graphics/ConvexShape.cpp b/src/SFML/Graphics/ConvexShape.cpp index 44693c24..93fa5c0c 100644 --- a/src/SFML/Graphics/ConvexShape.cpp +++ b/src/SFML/Graphics/ConvexShape.cpp @@ -31,13 +31,10 @@ namespace sf { //////////////////////////////////////////////////////////// -ConvexShape::ConvexShape() +ConvexShape::ConvexShape() : +myPoints() { - // Let's define a triangle by default... just so that it's not empty - SetPointsCount(3); - SetPoint(0, Vector2f(5, 0)); - SetPoint(1, Vector2f(0, 10)); - SetPoint(2, Vector2f(10, 10)); + Update(); } diff --git a/src/SFML/Graphics/RectangleShape.cpp b/src/SFML/Graphics/RectangleShape.cpp index ba8d0ebf..ea80e69e 100644 --- a/src/SFML/Graphics/RectangleShape.cpp +++ b/src/SFML/Graphics/RectangleShape.cpp @@ -32,9 +32,9 @@ namespace sf { //////////////////////////////////////////////////////////// -RectangleShape::RectangleShape() : -mySize(10, 10) +RectangleShape::RectangleShape(const Vector2f& size) : { + SetSize(size); } diff --git a/src/SFML/Graphics/StarShape.cpp b/src/SFML/Graphics/StarShape.cpp index 0f5696ef..9cf5c625 100644 --- a/src/SFML/Graphics/StarShape.cpp +++ b/src/SFML/Graphics/StarShape.cpp @@ -33,10 +33,21 @@ namespace sf { //////////////////////////////////////////////////////////// StarShape::StarShape() : -myInnerRadius(10), -myOuterRadius(20), -myPointsCount(5) +myInnerRadius(0), +myOuterRadius(0), +myPointsCount(0) { + Update(); +} + + +//////////////////////////////////////////////////////////// +StarShape::StarShape(float innerRadius, float outerRadius, unsigned int pointsCount) : +myInnerRadius(innerRadius), +myOuterRadius(outerRadius), +myPointsCount(pointsCount) +{ + Update(); }