projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'feature/surface-scaling'
[supertux.git]
/
src
/
math
/
aatriangle.hpp
diff --git
a/src/math/aatriangle.hpp
b/src/math/aatriangle.hpp
index
c9defc8
..
228c1e2
100644
(file)
--- a/
src/math/aatriangle.hpp
+++ b/
src/math/aatriangle.hpp
@@
-17,13
+17,13
@@
#ifndef HEADER_SUPERTUX_MATH_AATRIANGLE_HPP
#define HEADER_SUPERTUX_MATH_AATRIANGLE_HPP
#ifndef HEADER_SUPERTUX_MATH_AATRIANGLE_HPP
#define HEADER_SUPERTUX_MATH_AATRIANGLE_HPP
-#include "math/rect.hpp"
+#include "math/rect
f
.hpp"
/**
* An axis-aligned triangle (ie. a triangle where 2 sides are parallel to the x-
* and y-axis.
*/
/**
* 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:
{
public:
/** Directions:
@@
-42,22
+42,29
@@
public:
SOUTHEAST,
NORTHWEST,
DIRECTION_MASK = 0x0003,
SOUTHEAST,
NORTHWEST,
DIRECTION_MASK = 0x0003,
- DEFORM
1
= 0x0010,
- DEFORM
2
= 0x0020,
- DEFORM
3
= 0x0030,
- DEFORM
4
= 0x0040,
+ DEFORM
_BOTTOM
= 0x0010,
+ DEFORM
_TOP
= 0x0020,
+ DEFORM
_LEFT
= 0x0030,
+ DEFORM
_RIGHT
= 0x0040,
DEFORM_MASK = 0x0070
};
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;
};
int dir;
};