From 46989c8bfd43885e16cdf444adc7361d4f4d8776 Mon Sep 17 00:00:00 2001 From: rxi Date: Fri, 23 Sep 2016 20:04:42 +0100 Subject: [PATCH] Made `x, y` arguments to love.graphics.draw() optional --- src/graphics.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/graphics.c b/src/graphics.c index 3e4760f..fe1eef5 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -258,11 +258,11 @@ int l_graphics_draw(lua_State *L) { int x, y; if (!lua_isnone(L, 2) && lua_type(L, 2) != LUA_TNUMBER) { quad = luaobj_checkudata(L, 2, LUAOBJ_TYPE_QUAD); - x = luaL_checkint(L, 3); - y = luaL_checkint(L, 4); + x = luaL_optint(L, 3, 0); + y = luaL_optint(L, 4, 0); } else { - x = luaL_checkint(L, 2); - y = luaL_checkint(L, 3); + x = luaL_optint(L, 2, 0); + y = luaL_optint(L, 3, 0); } pixel_t *buf = graphics_canvas->data; int bufw = graphics_canvas->width;