Browse Source

Really fixed setScissor erroring when scissoring is disabled and x,y,w,h from getScissor is used (see issue #709)

Alex Szpakowski 12 years ago
parent
commit
1b5912a461
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/modules/graphics/opengl/wrap_Graphics.cpp

+ 4 - 1
src/modules/graphics/opengl/wrap_Graphics.cpp

@@ -83,7 +83,10 @@ int w_getDimensions(lua_State *L)
 
 
 int w_setScissor(lua_State *L)
 int w_setScissor(lua_State *L)
 {
 {
-	if (lua_gettop(L) <= 1 && lua_isnoneornil(L, 1))
+	int nargs = lua_gettop(L);
+
+	if (nargs == 0 || (nargs == 4 && lua_isnil(L, 1) && lua_isnil(L, 2)
+		&& lua_isnil(L, 3) && lua_isnil(L, 4)))
 	{
 	{
 		instance->setScissor();
 		instance->setScissor();
 		return 0;
 		return 0;