The Vertex struct is now recognized as POD by C++, also fixed the name to be consistent with other love structs

This commit is contained in:
Alex Szpakowski
2013-09-24 11:09:18 -03:00
parent 8d5ddb9e34
commit 5de43a7207
24 changed files with 127 additions and 129 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ void Matrix::shear(float kx, float ky)
// | e2 e6 e10 e14 |
// | e3 e7 e11 e15 |
void Matrix::transform(vertex *dst, const vertex *src, int size) const
void Matrix::transform(Vertex *dst, const Vertex *src, int size) const
{
for (int i = 0; i<size; i++)
{
+1 -1
View File
@@ -148,7 +148,7 @@ public:
* @param src The source vertices.
* @param size The number of vertices.
**/
void transform(vertex *dst, const vertex *src, int size) const;
void transform(Vertex *dst, const Vertex *src, int size) const;
private:
+4 -25
View File
@@ -61,40 +61,19 @@
namespace love
{
struct vertex
struct Vertex
{
vertex()
: r(255), g(255), b(255), a(255)
, x(0), y(0)
, s(0), t(0)
{}
vertex(float x, float y,
float s, float t)
: r(255), g(255), b(255), a(255)
, x(x), y(y)
, s(s), t(t)
{}
vertex(float x, float y,
float s, float t,
unsigned char r, unsigned char g, unsigned char b, unsigned char a)
: r(r), g(g), b(b), a(a)
, x(x), y(y)
, s(s), t(t)
{}
unsigned char r, g, b, a;
float x, y;
float s, t;
unsigned char r, g, b, a;
};
struct Triangle
{
Triangle(const vertex &x, const vertex &y, const vertex &z)
Triangle(const Vertex &x, const Vertex &y, const Vertex &z)
: a(x), b(y), c(z)
{}
vertex a, b, c;
Vertex a, b, c;
};
inline int next_p2(int x)