projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Silence compiler warning
[supertux.git]
/
src
/
math
/
aatriangle.hpp
diff --git
a/src/math/aatriangle.hpp
b/src/math/aatriangle.hpp
index
e37fa8a
..
228c1e2
100644
(file)
--- a/
src/math/aatriangle.hpp
+++ b/
src/math/aatriangle.hpp
@@
-17,7
+17,7
@@
#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/
vector
.hpp"
+#include "math/
rectf
.hpp"
/**
* An axis-aligned triangle (ie. a triangle where 2 sides are parallel to the x-
/**
* An axis-aligned triangle (ie. a triangle where 2 sides are parallel to the x-
@@
-42,40
+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
};
+ static int vertical_flip(int dir);
+
public:
AATriangle() :
public:
AATriangle() :
- p1(),
- p2(),
+ bbox(),
dir(SOUTHWEST)
{
}
dir(SOUTHWEST)
{
}
- AATriangle(const Vector& v1, const Vector& v2, int newdir) :
- p1(v1),
- p2(v2),
+ AATriangle(const Rectf& newbbox, int newdir) :
+ bbox(newbbox),
dir(newdir)
{
}
dir(newdir)
{
}
- float get_width() const
- {
- return p2.x - p1.x;
- }
-
- float get_height() const
- {
- return p2.y - p1.y;
- }
-
public:
public:
- Vector p1;
- Vector p2;
+ Rectf bbox;
int dir;
};
int dir;
};