[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r3834 - trunk/pingus/src/math
From: |
grumbel at BerliOS |
Subject: |
[Pingus-CVS] r3834 - trunk/pingus/src/math |
Date: |
Wed, 16 Jul 2008 13:55:35 +0200 |
Author: grumbel
Date: 2008-07-16 13:55:35 +0200 (Wed, 16 Jul 2008)
New Revision: 3834
Modified:
trunk/pingus/src/math/rect.cpp
trunk/pingus/src/math/rect.hpp
Log:
Removed some unused functions
Modified: trunk/pingus/src/math/rect.cpp
===================================================================
--- trunk/pingus/src/math/rect.cpp 2008-07-16 10:59:32 UTC (rev 3833)
+++ trunk/pingus/src/math/rect.cpp 2008-07-16 11:55:35 UTC (rev 3834)
@@ -33,33 +33,6 @@
#define cl_min(a,b) ((a < b) ? a : b)
#define cl_max(a,b) ((a > b) ? a : b)
-Rect Rect::get_rot_bounds(const Vector2i &hotspot, float angle) const
-{
-#if 0
- //Find the rotated positions of each corner
- Rect retVal(*this);
- Vector2i ul = Vector2i(retVal.left, retVal.top).rotate(hotspot, angle);
- Vector2i ur = Vector2i(retVal.right, retVal.top).rotate(hotspot, angle);
- Vector2i ll = Vector2i(retVal.left, retVal.bottom).rotate(hotspot,
angle);
- Vector2i lr = Vector2i(retVal.right, retVal.bottom).rotate(hotspot,
angle);
-
- //Use the sidemost corners as the bounds of the new rectangle
- retVal.left = cl_min(cl_min(ul.x, ur.x), cl_min(ll.x, lr.x));
- retVal.right = cl_max(cl_max(ul.x, ur.x), cl_max(ll.x, lr.x));
- retVal.top = cl_min(cl_min(ul.y, ur.y), cl_min(ll.y, lr.y));
- retVal.bottom = cl_max(cl_max(ul.y, ur.y), cl_max(ll.y, lr.y));
- return retVal;
-#endif
- return Rect();
-}
-
-Rect Rect::get_rot_bounds(Origin origin, int x, int y, float angle) const
-{
- return get_rot_bounds(
- Vector2i(left, top) + calc_origin(origin, get_size()) +
Vector2i(x, y),
- angle);
-}
-
std::ostream& operator<<(std::ostream& s, const Rect& rect)
{
return s << "Rect(" << rect.left << ", " << rect.top << ", "
Modified: trunk/pingus/src/math/rect.hpp
===================================================================
--- trunk/pingus/src/math/rect.hpp 2008-07-16 10:59:32 UTC (rev 3833)
+++ trunk/pingus/src/math/rect.hpp 2008-07-16 11:55:35 UTC (rev 3834)
@@ -144,15 +144,7 @@
{
return (r.left < right && r.right > left && r.top < bottom && r.bottom >
top);
}
-
- //: Returns another Rect containing a rotated version of this one.
- //param hotspot: Vector2i to rotate around.
- //param origin: Determines the hotspot point within the rectangle
- //param x, y: Offsets applied negatively to the hotspot point
- //param angle: Angle to rotate in degrees.
- Rect get_rot_bounds(const Vector2i &hotspot, float angle) const;
- Rect get_rot_bounds(Origin origin, int x, int y, float angle) const;
-
+
//! Operations:
public:
//: Sets the size of the rectangle, maintaining top/left position.
@@ -347,22 +339,7 @@
top = temp;
}
}
-#if 0
- //: Applies an origin and offset pair to this rectangle
- //param origin: The new origin to adjust to from default upper-left position
- //param x, y: Offsets applied negatively to each corner of the rectangle
- void apply_alignment(Origin origin, float x, float y)
- {
- Vector3f offset = calc_origin(origin, get_size());
- offset.x -= x;
- offset.y -= y;
-
- left += offset.x;
- top += offset.y;
- right += offset.x;
- bottom += offset.y;
- }
-#endif
+
// Moves each edge f away from the center, thus width = old_width + 2*f
Rectf grow(float f) const {
return Rectf(left - f,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r3834 - trunk/pingus/src/math,
grumbel at BerliOS <=