Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: tiny piece of superfluous code in Shape.cpp  (Read 1976 times)

0 Members and 1 Guest are viewing this topic.

T.T.H.

  • Full Member
  • ***
  • Posts: 112
    • View Profile
tiny piece of superfluous code in Shape.cpp
« on: February 09, 2010, 11:20:56 am »
Shape.cpp of SFML2 revision 1392:

Code: [Select]
Shape Shape::Rectangle(const Vector2f& p1, ...
{
    return Shape::Rectangle(p1.x, p1.y, ...
}

Shape Shape::Rectangle(float p1x, float p1y, ...
{
    // Create the shape's points
    Shape shape;
    shape.AddPoint(Vector2f(p1x, p1y), ...

Vector2f being converted to floats, floats being converted to Vector2f - seems a bit superfluous.

In the other functions (Shape::Line, Shape::Circle) it's different:
floats being converted to Vector2f, Vector2f being used - seems to make more sense.

Just a minor inconsistency I stumbled over...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
tiny piece of superfluous code in Shape.cpp
« Reply #1 on: February 09, 2010, 11:29:36 am »
This is because I don't use the points directly, I make combinations of their coordinates to produce the 4 points of the rectangle.
Laurent Gomila - SFML developer