From 173fe3dab5ddb976c6f0b8af13ef26425616ef52 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sat, 22 Jan 2022 23:27:53 -0400 Subject: [PATCH] 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. --- src/modules/graphics/wrap_Graphics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/graphics/wrap_Graphics.cpp b/src/modules/graphics/wrap_Graphics.cpp index 38a4bb47b..0b861aaa5 100644 --- a/src/modules/graphics/wrap_Graphics.cpp +++ b/src/modules/graphics/wrap_Graphics.cpp @@ -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 {