From 1b5912a46146a1d8095521d48ed26a787dcd99d8 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Wed, 21 Aug 2013 19:37:26 -0300 Subject: [PATCH] Really fixed setScissor erroring when scissoring is disabled and x,y,w,h from getScissor is used (see issue #709) --- src/modules/graphics/opengl/wrap_Graphics.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 37f92350e..acfb3af2f 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -83,7 +83,10 @@ int w_getDimensions(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(); return 0;