소스 검색

Restore no-parameter variant of love.graphics.setColorMask.

Sasha Szpakowski 1 년 전
부모
커밋
17362b6844
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/modules/graphics/wrap_Graphics.cpp

+ 5 - 1
src/modules/graphics/wrap_Graphics.cpp

@@ -2355,7 +2355,11 @@ int w_setColorMask(lua_State *L)
 {
 {
 	ColorChannelMask mask;
 	ColorChannelMask mask;
 
 
-	if (lua_gettop(L) <= 1)
+	if (lua_isnoneornil(L, 1))
+	{
+		mask.r = mask.g = mask.b = mask.a = true;
+	}
+	else if (lua_gettop(L) <= 1)
 	{
 	{
 		// Set all color components if a single argument is given.
 		// Set all color components if a single argument is given.
 		mask.r = mask.g = mask.b = mask.a = luax_checkboolean(L, 1);
 		mask.r = mask.g = mask.b = mask.a = luax_checkboolean(L, 1);