love.graphics.setColor no longer uses the main per-vertex color attribute. This lets it affect the color of ParticleSystems, and SpriteBatches and Meshes even when they use custom per-vertex colors.

This commit is contained in:
Alex Szpakowski
2015-06-21 11:20:26 -03:00
parent 42ae9c9585
commit c82ccbb89b
10 changed files with 21 additions and 51 deletions
+1 -3
View File
@@ -236,8 +236,6 @@ void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float
array_buf->unmap(buffer_used_offset, buffer_used_size);
buffer_used_offset = buffer_used_size = 0;
Color curcolor = gl.getColor();
// Apply per-sprite color, if a color is set.
if (color)
{
@@ -260,7 +258,7 @@ void SpriteBatch::draw(float x, float y, float angle, float sx, float sy, float
if (color)
{
glDisableVertexAttribArray(ATTRIB_COLOR);
gl.setColor(curcolor);
glVertexAttrib4f(ATTRIB_COLOR, 1.0f, 1.0f, 1.0f, 1.0f);
}
}