mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
love.graphics.setColorMask() with no arguments enabled all color components
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user