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
@@ -132,7 +132,7 @@ void ParticleSystem::createBuffers(size_t size)
try
{
pFree = pMem = new particle[size];
particleVerts = new love::vertex[size * 4];
particleVerts = new love::Vertex[size * 4];
maxParticles = (uint32) size;
}
catch (std::bad_alloc &)
@@ -746,8 +746,8 @@ void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, flo
t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky);
glMultMatrixf((const GLfloat *)t.getElements());
const vertex *imageVerts = image->getVertices();
vertex *pVerts = particleVerts;
const Vertex *imageVerts = image->getVertices();
Vertex *pVerts = particleVerts;
particle *p = pHead;
// set the vertex data for each particle (transformation, texcoords, color)
@@ -780,9 +780,9 @@ void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, flo
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(vertex), (GLvoid *) &particleVerts[0].r);
glVertexPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *) &particleVerts[0].x);
glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), (GLvoid *) &particleVerts[0].s);
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), (GLvoid *) &particleVerts[0].r);
glVertexPointer(2, GL_FLOAT, sizeof(Vertex), (GLvoid *) &particleVerts[0].x);
glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), (GLvoid *) &particleVerts[0].s);
glDrawArrays(GL_QUADS, 0, pCount * 4);