love.graphics.setColorMask() with no arguments enabled all color components

This commit is contained in:
Alex Szpakowski
2013-06-15 21:52:39 -03:00
parent 0a1c90f2d7
commit 15535517d6
+11 -2
View File
@@ -632,8 +632,17 @@ int w_getFont(lua_State *L)
int w_setColorMask(lua_State *L)
{
bool mask[4];
for (int i = 0; i < 4; i++)
mask[i] = luax_toboolean(L, i + 1);
if (lua_gettop(L) == 0)
{
// Enable all color components if no argument is given.
mask[0] = mask[1] = mask[2] = mask[3] = true;
}
else
{
for (int i = 0; i < 4; i++)
mask[i] = luax_toboolean(L, i + 1);
}
// r, g, b, a
instance->setColorMask(mask[0], mask[1], mask[2], mask[3]);