From 394888bd13bcdf033908710d3e58eb0db0e331d1 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 21 Aug 2013 18:52:07 -0300 Subject: [PATCH] Fixed love.graphics.setScissor and love.graphics.setColorMask to not error if a single nil argument is given (resolves issue #709) --- src/modules/graphics/opengl/wrap_Graphics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index da9b114cc..37f92350e 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -83,7 +83,7 @@ int w_getDimensions(lua_State *L) int w_setScissor(lua_State *L) { - if (lua_gettop(L) == 0) + if (lua_gettop(L) <= 1 && lua_isnoneornil(L, 1)) { instance->setScissor(); return 0; @@ -688,7 +688,7 @@ int w_setColorMask(lua_State *L) { bool mask[4]; - if (lua_gettop(L) == 0) + if (lua_gettop(L) <= 1 && lua_isnoneornil(L, 1)) { // Enable all color components if no argument is given. mask[0] = mask[1] = mask[2] = mask[3] = true; @@ -848,7 +848,7 @@ int w_setLineJoin(lua_State *L) Graphics::LineJoin join; const char *str = luaL_checkstring(L, 1); if (!Graphics::getConstant(str, join)) - return luaL_error(L, "Invalid line join: %s", str); + return luaL_error(L, "Invalid line join mode: %s", str); instance->setLineJoin(join); return 0;