Fix for uninitialized members
[supertux.git] / src / math / aatriangle.hpp
index c9defc8..228c1e2 100644 (file)
 #ifndef HEADER_SUPERTUX_MATH_AATRIANGLE_HPP
 #define HEADER_SUPERTUX_MATH_AATRIANGLE_HPP
 
-#include "math/rect.hpp"
+#include "math/rectf.hpp"
 
 /**
  * An axis-aligned triangle (ie. a triangle where 2 sides are parallel to the x-
  * and y-axis.
  */
-class AATriangle : public Rect // FIXME: yuck
+class AATriangle
 {
 public:
   /** Directions:
@@ -42,22 +42,29 @@ public:
     SOUTHEAST,
     NORTHWEST,
     DIRECTION_MASK = 0x0003,
-    DEFORM1 = 0x0010,
-    DEFORM2 = 0x0020,
-    DEFORM3 = 0x0030,
-    DEFORM4 = 0x0040,
+    DEFORM_BOTTOM = 0x0010,
+    DEFORM_TOP = 0x0020,
+    DEFORM_LEFT = 0x0030,
+    DEFORM_RIGHT = 0x0040,
     DEFORM_MASK = 0x0070
   };
 
-  AATriangle()
-    : dir(SOUTHWEST)
+  static int vertical_flip(int dir);
+
+public:
+  AATriangle() :
+    bbox(),
+    dir(SOUTHWEST)
   {
   }
-  AATriangle(const Vector& v1, const Vector& v2, int newdir)
-    : Rect(v1, v2), dir(newdir)
+  AATriangle(const Rectf& newbbox, int newdir) :
+    bbox(newbbox),
+    dir(newdir)
   {
   }
 
+public:
+  Rectf bbox;
   int dir;
 };