1. Bart van Strien
  2. love-experiments

Commits

Alex Szpakowski  committed d42d107

Fixed love.graphics.setScissor and love.graphics.setColorMask to not error if a single nil argument is given (resolves issue #709)

  • Participants
  • Parent commits 6ede4b2
  • Branches default

Comments (0)

Files changed (1)

File src/modules/graphics/opengl/wrap_Graphics.cpp

View file
  • Ignore whitespace
 
 int w_setScissor(lua_State *L)
 {
-	if (lua_gettop(L) == 0)
+	if (lua_gettop(L) <= 1 && lua_isnoneornil(L, 1))
 	{
 		instance->setScissor();
 		return 0;
 {
 	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;
 	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;