Ensure the current color is set properly after drawing particlesystems and spritebatches

This commit is contained in:
Alex Szpakowski
2013-04-12 15:40:53 -03:00
parent 3edf033498
commit 6a27e1aa2f
2 changed files with 9 additions and 2 deletions
@@ -514,8 +514,9 @@ void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, flo
int numParticles = count();
if (numParticles == 0) return; // don't bother if there's nothing to do
Color curcolor = opengl::getCurrentColor();
glPushMatrix();
glPushAttrib(GL_CURRENT_BIT);
static Matrix t;
t.setTransformation(x, y, angle, sx, sy, ox, oy, kx, ky);
@@ -576,8 +577,9 @@ void ParticleSystem::draw(float x, float y, float angle, float sx, float sy, flo
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glPopAttrib();
glPopMatrix();
opengl::setCurrentColor(curcolor);
}
void ParticleSystem::update(float dt)