From aaf080368bc2075e2cf73673e2e3f9ec91187947 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Thu, 13 May 2010 11:00:29 +0000 Subject: [PATCH] Fixed header missing in the voip sample Minor additions to the API documentation of the drawable classes git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1520 4e206d99-4929-0410-ac5d-dfc041789085 --- include/SFML/Graphics/Drawable.hpp | 257 ++++++++++++++++++++----- include/SFML/Graphics/RenderTarget.hpp | 2 +- include/SFML/Graphics/Renderer.hpp | 2 +- include/SFML/Graphics/Shape.hpp | 12 +- include/SFML/Graphics/Sprite.hpp | 26 +++ include/SFML/Graphics/Text.hpp | 56 +++++- include/SFML/Network/Packet.hpp | 8 +- samples/voip/Server.cpp | 1 + src/SFML/Graphics/Drawable.cpp | 72 +------ 9 files changed, 307 insertions(+), 129 deletions(-) diff --git a/include/SFML/Graphics/Drawable.hpp b/include/SFML/Graphics/Drawable.hpp index 23983730b..d110780fb 100644 --- a/include/SFML/Graphics/Drawable.hpp +++ b/include/SFML/Graphics/Drawable.hpp @@ -239,132 +239,212 @@ public : /// /// This global color affects the entire object, and modulates /// (multiplies) its original pixels. + /// The default color is white. /// - /// The default color is white + /// \param color New color /// - /// \param color : New color + /// \see GetColor /// //////////////////////////////////////////////////////////// void SetColor(const Color& color); //////////////////////////////////////////////////////////// - /// Set the blending mode for the object. - /// The default blend mode is Blend::Alpha + /// \brief Set the blending mode of the object /// - /// \param mode : New blending mode + /// This property defines how the pixels of an object are + /// blended with the pixels of the render target to which + /// it is drawn. To know more about the blending modes + /// available, see the sf::Blend::Mode enum. + /// The default blend mode is Blend::Alpha. + /// + /// \param mode New blending mode + /// + /// \see GetBlendMode /// //////////////////////////////////////////////////////////// void SetBlendMode(Blend::Mode mode); //////////////////////////////////////////////////////////// - /// Get the position of the object + /// \brief Get the position of the object /// /// \return Current position /// + /// \see SetPosition + /// //////////////////////////////////////////////////////////// const Vector2f& GetPosition() const; //////////////////////////////////////////////////////////// - /// Get the current scale of the object + /// \brief Get the current scale of the object /// - /// \return Current scale factor (always positive) + /// \return Current scale factors + /// + /// \see SetScale /// //////////////////////////////////////////////////////////// const Vector2f& GetScale() const; //////////////////////////////////////////////////////////// - /// Get the local origin of the object + /// \brief Get the local origin of the object /// - /// \return Current position of the origin + /// \return Current origin + /// + /// \see SetOrigin /// //////////////////////////////////////////////////////////// const Vector2f& GetOrigin() const; //////////////////////////////////////////////////////////// - /// Get the orientation of the object. - /// Rotation is always in the range [0, 360] + /// \brief Get the orientation of the object + /// + /// The rotation is always in the range [0, 360]. /// /// \return Current rotation, in degrees /// + /// \see SetRotation + /// //////////////////////////////////////////////////////////// float GetRotation() const; //////////////////////////////////////////////////////////// - /// Get the color of the object + /// \brief Get the color of the object /// /// \return Current color /// + /// \see SetColor + /// //////////////////////////////////////////////////////////// const Color& GetColor() const; //////////////////////////////////////////////////////////// - /// Get the current blending mode + /// \brief Get the blend mode of the object /// - /// \return Current blending mode + /// \return Current blend mode + /// + /// \see SetBlendMode /// //////////////////////////////////////////////////////////// Blend::Mode GetBlendMode() const; //////////////////////////////////////////////////////////// - /// Move the object of a given offset (take 2 values) + /// \brief Move the object by a given offset /// - /// \param offsetX : X offset - /// \param offsetY : Y offset + /// This function adds to the current position of the object, + /// unlike SetPosition which overwrites it. + /// Thus, it is equivalent to the following code: + /// \code + /// sf::Vector2f pos = object.GetPosition(); + /// object.SetPosition(pos.x + offsetX, pos.y + offsetY); + /// \endcode + /// + /// \param offsetX X offset + /// \param offsetY Y offset + /// + /// \see SetPosition /// //////////////////////////////////////////////////////////// void Move(float offsetX, float offsetY); //////////////////////////////////////////////////////////// - /// Move the object of a given offset (take a 2D vector) + /// \brief Move the object by a given offset /// - /// \param offset : Amount of units to move the object of + /// This function adds to the current position of the object, + /// unlike SetPosition which overwrites it. + /// Thus, it is equivalent to the following code: + /// \code + /// object.SetPosition(object.GetPosition() + offset); + /// \endcode + /// + /// \param offset Offset + /// + /// \see SetPosition /// //////////////////////////////////////////////////////////// void Move(const Vector2f& offset); //////////////////////////////////////////////////////////// - /// Scale the object (take 2 values) + /// \brief Scale the object /// - /// \param factorX : Scaling factor on X (must be strictly positive) - /// \param factorY : Scaling factor on Y (must be strictly positive) + /// This function multiplies the current scale of the object, + /// unlike SetScale which overwrites it. + /// Thus, it is equivalent to the following code: + /// \code + /// sf::Vector2f scale = object.GetScale(); + /// object.SetScale(scale.x * factorX, scale.y * factorY); + /// \endcode + /// + /// \param factorX Horizontal scale factor + /// \param factorY Vertical scale factor + /// + /// \see SetScale /// //////////////////////////////////////////////////////////// void Scale(float factorX, float factorY); //////////////////////////////////////////////////////////// - /// Scale the object (take a 2D vector) + /// \brief Scale the object /// - /// \param factor : Scaling factors (both values must be strictly positive) + /// This function multiplies the current scale of the object, + /// unlike SetScale which overwrites it. + /// Thus, it is equivalent to the following code: + /// \code + /// sf::Vector2f scale = object.GetScale(); + /// object.SetScale(scale.x * factor.x, scale.y * factor.y); + /// \endcode + /// + /// \param factor Scale factors + /// + /// \see SetScale /// //////////////////////////////////////////////////////////// void Scale(const Vector2f& factor); //////////////////////////////////////////////////////////// - /// Rotate the object + /// \brief Rotate the object /// - /// \param Angle : Angle of rotation, in degrees + /// This function ads to the current rotation of the object, + /// unlike SetRotation which overwrites it. + /// Thus, it is equivalent to the following code: + /// \code + /// object.SetRotation(object.GetRotation() + angle); + /// \endcode + /// + /// \param angle Angle of rotation, in degrees /// //////////////////////////////////////////////////////////// - void Rotate(float Angle); + void Rotate(float angle); //////////////////////////////////////////////////////////// - /// Transform a point from global coordinates into local coordinates - /// (ie it applies the inverse of object's origin, translation, rotation and scale to the point) + /// \brief Transform a point in object local coordinates /// - /// \param point : Point to transform + /// This function takes a point in global coordinates, and + /// transforms it in coordinates local to the object. + /// In other words, it applies the inverse of all the + /// transformations applied to the object (origin, + /// translation, rotation and scale). /// - /// \return Transformed point + /// \param point Point to transform + /// + /// \return The transformed point + /// + /// \see TransformToGlobal /// //////////////////////////////////////////////////////////// Vector2f TransformToLocal(const Vector2f& point) const; //////////////////////////////////////////////////////////// - /// Transform a point from local coordinates into global coordinates - /// (ie it applies the object's origin, translation, rotation and scale to the point) + /// \brief Transform a local point in global coordinates /// - /// \param point : Point to transform + /// This function takes a point in local coordinates, and + /// transforms it in global coordinates. In other words, + /// it applies the same transformations that are applied + /// to the object (origin, translation, rotation and scale). /// - /// \return Transformed point + /// \param point Point to transform + /// + /// \return The transformed point + /// + /// \see TransformToLocal /// //////////////////////////////////////////////////////////// Vector2f TransformToGlobal(const Vector2f& point) const; @@ -372,18 +452,22 @@ public : protected : //////////////////////////////////////////////////////////// - /// Get the transform matrix of the drawable + /// \brief Get the transform matrix of the object /// /// \return Transform matrix /// + /// \see GetInverseMatrix + /// //////////////////////////////////////////////////////////// const Matrix3& GetMatrix() const; //////////////////////////////////////////////////////////// - /// Get the inverse transform matrix of the drawable + /// \brief Get the inverse transform matrix of the object /// /// \return Inverse transform matrix /// + /// \see GetMatrix + /// //////////////////////////////////////////////////////////// const Matrix3& GetInverseMatrix() const; @@ -392,19 +476,27 @@ private : friend class RenderTarget; //////////////////////////////////////////////////////////// - /// Draw the object into the specified render target + /// \brief Draw the object to a render target /// - /// \param target : Target into which render the object - /// \param renderer : Renderer that processes the rendering commands + /// This function applies the common states of the object, + /// then calls the virtual Render functions to let the derived + /// class draw the geometry of the object. + /// + /// \param target Render target + /// \param renderer Renderer providing low-level rendering commands /// //////////////////////////////////////////////////////////// void Draw(RenderTarget& target, Renderer& renderer) const; //////////////////////////////////////////////////////////// - /// Render the specific geometry of the object + /// \brief Draw the object to a render target /// - /// \param target : Target into which render the object - /// \param renderer : Renderer that processes the rendering commands + /// This is a pure virtual function that has to be implemented + /// by the derived class to define how the drawable should be + /// rendered. + /// + /// \param target Render target + /// \param renderer Renderer providing low-level rendering commands /// //////////////////////////////////////////////////////////// virtual void Render(RenderTarget& target, Renderer& renderer) const = 0; @@ -428,3 +520,80 @@ private : #endif // SFML_DRAWABLE_HPP + + +//////////////////////////////////////////////////////////// +/// \class sf::Drawable +/// +/// sf::Drawable defines the attributes and operations that +/// are common to all the drawable classes: +/// \li transformations (position, rotation, scale, local origin) +/// \li global overlay color +/// \li blending mode with background pixels +/// \li the ability to be drawn on a sf::RenderTarget (either RenderWindow or RenderImage) +/// +/// Please note that all these attributes are hardware accelerated, +/// therefore they are extremely cheap to use (unlike older +/// libraries that perform slow transformations on the CPU, such as +/// rotation or scale). +/// +/// Usage example: +/// \code +/// // Here we'll use a sf::Sprite to demonstrate the features of sf::Drawable +/// sf::Sprite drawable = /* ...whatever... */; +/// +/// drawable.SetOrigin(10, 20); // set its origin to the local point (10, 20) +/// drawable.SetPosition(100, 100); // set its position to (100, 100) +/// drawable.SetRotation(45); // set its orientation to 45 degrees +/// drawable.SetColor(sf::Color::Red); // set its global color to red +/// drawable.SetBlendingMode(sf::Blend::Add); // set an additive blend mode +/// +/// window.Draw(drawable); // finally draw it (window is a sf::RenderWindow) +/// \endcode +/// +/// Deriving your own class from sf::Drawable is possible, however +/// you have to use the sf::Renderer class instead of direct OpenGL +/// calls, which is more limited. To create a derived drawable class, +/// all you have to do is to override the virtual Render function. +/// +/// One of the main benefits of creating your own drawable class is +/// that you can build hierarchies of drawable objects. Indeed, +/// when you draw a drawable inside the Render function of another +/// drawable, the former inherits the transformations and color of +/// the latter and combines them with its own attributes. +/// This way, you can apply global transformations/color to a set +/// of drawables as if it was a single entity. +/// +/// Example: +/// \code +/// class MyDrawable : public sf::Drawable +/// { +/// public : +/// +/// ... +/// +/// private : +/// +/// virtual void Render(sf::RenderTarget& target, sf::Renderer& renderer) const +/// { +/// // Low-level geometry rendering +/// renderer.SetTexture(&myTexture); +/// renderer.Begin(sf::Renderer::QuadList); +/// renderer.AddVertex(...); +/// renderer.AddVertex(...); +/// renderer.AddVertex(...); +/// renderer.AddVertex(...); +/// renderer.End(); +/// +/// // High-level drawable rendering +/// target.Draw(mySubSprite); +/// } +/// +/// sf::Image myTexture; +/// sf::Sprite mySubSprite; +/// }; +/// \endcode +/// +/// \see sf::Shape, sf::Sprite, sf::Text +/// +//////////////////////////////////////////////////////////// diff --git a/include/SFML/Graphics/RenderTarget.hpp b/include/SFML/Graphics/RenderTarget.hpp index 65c283ee6..7adb19f20 100644 --- a/include/SFML/Graphics/RenderTarget.hpp +++ b/include/SFML/Graphics/RenderTarget.hpp @@ -229,7 +229,7 @@ public : /// /// More specifically, it must be used around code that /// calls Draw functions. Example: - /// \begincode + /// \code /// // OpenGL code here... /// window.SaveGLStates(); /// window.Draw(...); diff --git a/include/SFML/Graphics/Renderer.hpp b/include/SFML/Graphics/Renderer.hpp index 2e3cb8582..d660ad638 100644 --- a/include/SFML/Graphics/Renderer.hpp +++ b/include/SFML/Graphics/Renderer.hpp @@ -241,7 +241,7 @@ public : /// between Begin() and End(). /// /// Usage: - /// \begincode + /// \code /// renderer.Begin(Renderer::TriangleList); /// renderer.AddVertex(...); /// renderer.AddVertex(...); diff --git a/include/SFML/Graphics/Shape.hpp b/include/SFML/Graphics/Shape.hpp index afa2274de..a06e8fc47 100644 --- a/include/SFML/Graphics/Shape.hpp +++ b/include/SFML/Graphics/Shape.hpp @@ -242,7 +242,7 @@ public : /// /// This is a static function that returns a new object, /// don't try to call it on an existing object to modify it. - /// \begincode + /// \code /// sf::Shape line = sf::Shape::Line(0, 0, 10, 20, 2.5f, sf::Color::Green); /// \endcode /// @@ -265,7 +265,7 @@ public : /// /// This is a static function that returns a new object, /// don't try to call it on an existing object to modify it. - /// \begincode + /// \code /// sf::Vector2f start(0, 0); /// sf::Vector2f end(10, 20); /// sf::Shape line = sf::Shape::Line(start, end, 2.5f, sf::Color::Green); @@ -288,7 +288,7 @@ public : /// /// This is a static function that returns a new object, /// don't try to call it on an existing object to modify it. - /// \begincode + /// \code /// sf::Shape rect = sf::Shape::Rectangle(10, 20, 50, 100, sf::Color::Red); /// \endcode /// @@ -310,7 +310,7 @@ public : /// /// This is a static function that returns a new object, /// don't try to call it on an existing object to modify it. - /// \begincode + /// \code /// sf::FloatRect source(10, 20, 50, 100); /// sf::Shape rect = sf::Shape::Rectangle(source, sf::Color::Red); /// \endcode @@ -330,7 +330,7 @@ public : /// /// This is a static function that returns a new object, /// don't try to call it on an existing object to modify it. - /// \begincode + /// \code /// sf::Shape circle = sf::Shape::Circle(0, 0, 7, sf::Color::Blue); /// \endcode /// @@ -351,7 +351,7 @@ public : /// /// This is a static function that returns a new object, /// don't try to call it on an existing object to modify it. - /// \begincode + /// \code /// sf::Vector2f center(0, 0); /// sf::Shape circle = sf::Shape::Circle(center, 7, sf::Color::Blue); /// \endcode diff --git a/include/SFML/Graphics/Sprite.hpp b/include/SFML/Graphics/Sprite.hpp index ea3f74916..100f832f6 100644 --- a/include/SFML/Graphics/Sprite.hpp +++ b/include/SFML/Graphics/Sprite.hpp @@ -239,3 +239,29 @@ private : #endif // SFML_SPRITE_HPP + + +//////////////////////////////////////////////////////////// +/// \class sf::Sprite +/// +/// ... +/// +/// Usage example: +/// \code +/// // Declare and load an image +/// sf::Image image; +/// image.LoadFromFile("image.png"); +/// +/// // Create a sprite +/// sf::Sprite sprite; +/// text.SetImage(image); +/// text.SetSubRect(sf::IntRect(10, 10, 50, 30)); +/// text.Resize(100, 60); +/// +/// // Display it +/// window.Draw(sprite); // window is a sf::RenderWindow +/// \endcode +/// +/// \see sf::Image +/// +//////////////////////////////////////////////////////////// diff --git a/include/SFML/Graphics/Text.hpp b/include/SFML/Graphics/Text.hpp index 56bec49b5..dabdc544e 100644 --- a/include/SFML/Graphics/Text.hpp +++ b/include/SFML/Graphics/Text.hpp @@ -82,7 +82,7 @@ public : /// The \a string argument is a sf::String, which can /// automatically be constructed from standard string types. /// So, the following calls are all valid: - /// \begincode + /// \code /// text.SetString("hello"); /// text.SetString(L"hello"); /// text.SetString(std::string("hello")); @@ -142,7 +142,7 @@ public : /// The returned string is a sf::String, which can automatically /// be converted to standard string types. So, the following /// lines of code are all valid: - /// \begincode + /// \code /// sf::String s1 = text.GetString(); /// std::string s2 = text.GetString(); /// std::wstring s3 = text.GetString(); @@ -250,3 +250,55 @@ private : #endif // SFML_TEXT_HPP + + +//////////////////////////////////////////////////////////// +/// \class sf::Text +/// +/// sf::Text is a drawable class that allows to easily display +/// some text with custom style and color on a render target. +/// +/// It inherits all the functions from sf::Drawable: +/// position, rotation, scale, origin, global color and blend +/// mode. It also adds text-specific properties such as the +/// font to use, the character size, the font style (bold, +/// italic, underlined), and the text to display of course. +/// It also provides convenience functions to calculate the +/// graphical size of the text, or to get the visual position +/// of a given character. +/// +/// sf::Text works in combination with the sf::Font class, which +/// loads and provides the glyphs (visual characters) of a given font. +/// +/// The separation of sf::Font and sf::Text allows more flexibility +/// and better performances: indeed a sf::Font is a heavy resource, +/// and any operation on it is slow (often too slow for real-time +/// applications). On the other side, a sf::Text is a lightweight +/// object which can combine the glyphs data and metrics of a sf::Font +/// to display any text on a render target. +/// +/// It is important to note that the sf::Text instance doesn't +/// copy the font that it uses, it only keeps a reference to it. +/// Thus, a sf::Font must not be destructed while it is +/// used by a sf::Text (i.e. never write a function that +/// uses a local sf::Font instance for creating a text). +/// +/// Usage example: +/// \code +/// // Declare and load a font +/// sf::Font font; +/// font.LoadFromFile("arial.ttf"); +/// +/// // Create a text +/// sf::Text text("hello"); +/// text.SetFont(font); +/// text.SetCharacterSize(30); +/// text.SetStyle(sf::Text::Regular); +/// +/// // Display it +/// window.Draw(text); // window is a sf::RenderWindow +/// \endcode +/// +/// \see sf::Font +/// +//////////////////////////////////////////////////////////// diff --git a/include/SFML/Network/Packet.hpp b/include/SFML/Network/Packet.hpp index aed0faf58..04f874010 100644 --- a/include/SFML/Network/Packet.hpp +++ b/include/SFML/Network/Packet.hpp @@ -137,7 +137,7 @@ public : /// This behaviour is the same as standard C++ streams. /// /// Usage example: - /// \begincode + /// \code /// float x; /// packet >> x; /// if (packet) @@ -289,7 +289,7 @@ private : /// and your data may be corrupted if that happens. /// /// Usage example: -/// \begincode +/// \code /// sf::Uint32 x = 24; /// std::string s = "hello"; /// double d = 5.89; @@ -328,7 +328,7 @@ private : /// overloads of operators >> and << in order to handle your /// custom types. /// -/// \begincode +/// \code /// struct MyStruct /// { /// float number; @@ -355,7 +355,7 @@ private : /// the OnSend and OnReceive functions. /// /// Here is an example: -/// \begincode +/// \code /// class ZipPacket : public sf::Packet /// { /// virtual const char* OnSend(std::size_t& size) diff --git a/samples/voip/Server.cpp b/samples/voip/Server.cpp index 784ea02cc..d8c3a4051 100644 --- a/samples/voip/Server.cpp +++ b/samples/voip/Server.cpp @@ -6,6 +6,7 @@ #include #include #include +#include const sf::Uint8 audioData = 1; diff --git a/src/SFML/Graphics/Drawable.cpp b/src/SFML/Graphics/Drawable.cpp index 9c3849060..60221a426 100644 --- a/src/SFML/Graphics/Drawable.cpp +++ b/src/SFML/Graphics/Drawable.cpp @@ -34,8 +34,6 @@ namespace sf { //////////////////////////////////////////////////////////// -/// Default constructor -//////////////////////////////////////////////////////////// Drawable::Drawable(const Vector2f& position, const Vector2f& scale, float rotation, const Color& color) : myPosition (position), myScale (scale), @@ -49,8 +47,6 @@ myInvMatrixUpdated(false) } -//////////////////////////////////////////////////////////// -/// Virtual destructor //////////////////////////////////////////////////////////// Drawable::~Drawable() { @@ -58,8 +54,6 @@ Drawable::~Drawable() } -//////////////////////////////////////////////////////////// -/// Set the position of the object (take 2 values) //////////////////////////////////////////////////////////// void Drawable::SetPosition(float x, float y) { @@ -68,8 +62,6 @@ void Drawable::SetPosition(float x, float y) } -//////////////////////////////////////////////////////////// -/// Set the position of the object (take a 2D vector) //////////////////////////////////////////////////////////// void Drawable::SetPosition(const Vector2f& position) { @@ -78,8 +70,6 @@ void Drawable::SetPosition(const Vector2f& position) } -//////////////////////////////////////////////////////////// -/// Set the X position of the object //////////////////////////////////////////////////////////// void Drawable::SetX(float x) { @@ -90,8 +80,6 @@ void Drawable::SetX(float x) } -//////////////////////////////////////////////////////////// -/// Set the Y position of the object //////////////////////////////////////////////////////////// void Drawable::SetY(float y) { @@ -102,8 +90,6 @@ void Drawable::SetY(float y) } -//////////////////////////////////////////////////////////// -/// Set the scale of the object (take 2 values) //////////////////////////////////////////////////////////// void Drawable::SetScale(float factorX, float factorY) { @@ -112,8 +98,6 @@ void Drawable::SetScale(float factorX, float factorY) } -//////////////////////////////////////////////////////////// -/// Set the scale of the object (take a 2D vector) //////////////////////////////////////////////////////////// void Drawable::SetScale(const Vector2f& scale) { @@ -122,8 +106,6 @@ void Drawable::SetScale(const Vector2f& scale) } -//////////////////////////////////////////////////////////// -/// Set the X scale factor of the object //////////////////////////////////////////////////////////// void Drawable::SetScaleX(float factor) { @@ -137,8 +119,6 @@ void Drawable::SetScaleX(float factor) } -//////////////////////////////////////////////////////////// -/// Set the Y scale factor of the object //////////////////////////////////////////////////////////// void Drawable::SetScaleY(float factor) { @@ -152,10 +132,6 @@ void Drawable::SetScaleY(float factor) } -//////////////////////////////////////////////////////////// -/// Set the local origin of the object, in coordinates relative to the -/// top-left of the object (take 2 values). -/// The default origin is (0, 0) //////////////////////////////////////////////////////////// void Drawable::SetOrigin(float x, float y) { @@ -167,10 +143,6 @@ void Drawable::SetOrigin(float x, float y) } -//////////////////////////////////////////////////////////// -/// Set the local origin of the object, in coordinates relative to the -/// top-left of the object (take a 2D vector). -/// The default origin is (0, 0) //////////////////////////////////////////////////////////// void Drawable::SetOrigin(const Vector2f& origin) { @@ -178,8 +150,6 @@ void Drawable::SetOrigin(const Vector2f& origin) } -//////////////////////////////////////////////////////////// -/// Set the orientation of the object //////////////////////////////////////////////////////////// void Drawable::SetRotation(float angle) { @@ -192,9 +162,6 @@ void Drawable::SetRotation(float angle) } -//////////////////////////////////////////////////////////// -/// Set the color of the object. -/// The default color is white //////////////////////////////////////////////////////////// void Drawable::SetColor(const Color& color) { @@ -202,9 +169,6 @@ void Drawable::SetColor(const Color& color) } -//////////////////////////////////////////////////////////// -/// Set the blending mode for the object. -/// The default blend mode is Blend::Alpha //////////////////////////////////////////////////////////// void Drawable::SetBlendMode(Blend::Mode mode) { @@ -212,8 +176,6 @@ void Drawable::SetBlendMode(Blend::Mode mode) } -//////////////////////////////////////////////////////////// -/// Get the position of the object //////////////////////////////////////////////////////////// const Vector2f& Drawable::GetPosition() const { @@ -221,8 +183,6 @@ const Vector2f& Drawable::GetPosition() const } -//////////////////////////////////////////////////////////// -/// Get the current scale of the object //////////////////////////////////////////////////////////// const Vector2f& Drawable::GetScale() const { @@ -230,8 +190,6 @@ const Vector2f& Drawable::GetScale() const } -//////////////////////////////////////////////////////////// -/// Get the origin of the object //////////////////////////////////////////////////////////// const Vector2f& Drawable::GetOrigin() const { @@ -239,8 +197,6 @@ const Vector2f& Drawable::GetOrigin() const } -//////////////////////////////////////////////////////////// -/// Get the orientation of the object //////////////////////////////////////////////////////////// float Drawable::GetRotation() const { @@ -248,8 +204,6 @@ float Drawable::GetRotation() const } -//////////////////////////////////////////////////////////// -/// Get the color of the object //////////////////////////////////////////////////////////// const Color& Drawable::GetColor() const { @@ -257,8 +211,6 @@ const Color& Drawable::GetColor() const } -//////////////////////////////////////////////////////////// -/// Get the current blending mode //////////////////////////////////////////////////////////// Blend::Mode Drawable::GetBlendMode() const { @@ -266,9 +218,6 @@ Blend::Mode Drawable::GetBlendMode() const } -//////////////////////////////////////////////////////////// -/// Move the object of a given offset (take 2 values) -/// //////////////////////////////////////////////////////////// void Drawable::Move(float offsetX, float offsetY) { @@ -276,8 +225,6 @@ void Drawable::Move(float offsetX, float offsetY) } -//////////////////////////////////////////////////////////// -/// Move the object of a given offset (take a 2D vector) //////////////////////////////////////////////////////////// void Drawable::Move(const Vector2f& offset) { @@ -285,8 +232,6 @@ void Drawable::Move(const Vector2f& offset) } -//////////////////////////////////////////////////////////// -/// Scale the object (take 2 values) //////////////////////////////////////////////////////////// void Drawable::Scale(float factorX, float factorY) { @@ -294,8 +239,6 @@ void Drawable::Scale(float factorX, float factorY) } -//////////////////////////////////////////////////////////// -/// Scale the object (take a 2D vector) //////////////////////////////////////////////////////////// void Drawable::Scale(const Vector2f& factor) { @@ -303,8 +246,6 @@ void Drawable::Scale(const Vector2f& factor) } -//////////////////////////////////////////////////////////// -/// Rotate the object //////////////////////////////////////////////////////////// void Drawable::Rotate(float angle) { @@ -312,18 +253,13 @@ void Drawable::Rotate(float angle) } -//////////////////////////////////////////////////////////// -/// Transform a point from global coordinates into local coordinates -/// (ie it applies the inverse of object's origin, translation, rotation and scale to the point) //////////////////////////////////////////////////////////// Vector2f Drawable::TransformToLocal(const Vector2f& point) const { return GetInverseMatrix().Transform(point); } -//////////////////////////////////////////////////////////// -/// Transform a point from local coordinates into global coordinates -/// (ie it applies the object's origin, translation, rotation and scale to the point) + //////////////////////////////////////////////////////////// Vector2f Drawable::TransformToGlobal(const Vector2f& point) const { @@ -331,8 +267,6 @@ Vector2f Drawable::TransformToGlobal(const Vector2f& point) const } -//////////////////////////////////////////////////////////// -/// Get the transform matrix of the drawable //////////////////////////////////////////////////////////// const Matrix3& Drawable::GetMatrix() const { @@ -347,8 +281,6 @@ const Matrix3& Drawable::GetMatrix() const } -//////////////////////////////////////////////////////////// -/// Get the inverse transform matrix of the drawable //////////////////////////////////////////////////////////// const Matrix3& Drawable::GetInverseMatrix() const { @@ -363,8 +295,6 @@ const Matrix3& Drawable::GetInverseMatrix() const } -//////////////////////////////////////////////////////////// -/// Draw the object into the specified render target //////////////////////////////////////////////////////////// void Drawable::Draw(RenderTarget& target, Renderer& renderer) const {