mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Add a love.graphics.setColorMask variant which accepts a single bool.
Remove the variant which accepted no args - it would be too confusing because setColorMask(false) does the opposite of what setColorMask(nil) used to do.
This commit is contained in:
@@ -2220,10 +2220,10 @@ int w_setColorMask(lua_State *L)
|
||||
{
|
||||
ColorChannelMask mask;
|
||||
|
||||
if (lua_gettop(L) <= 1 && lua_isnoneornil(L, 1))
|
||||
if (lua_gettop(L) <= 1)
|
||||
{
|
||||
// Enable all color components if no argument is given.
|
||||
mask.r = mask.g = mask.b = mask.a = true;
|
||||
// Set all color components if a single argument is given.
|
||||
mask.r = mask.g = mask.b = mask.a = luax_checkboolean(L, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user