Made x, y arguments to love.graphics.draw() optional
This commit is contained in:
@@ -258,11 +258,11 @@ int l_graphics_draw(lua_State *L) {
|
|||||||
int x, y;
|
int x, y;
|
||||||
if (!lua_isnone(L, 2) && lua_type(L, 2) != LUA_TNUMBER) {
|
if (!lua_isnone(L, 2) && lua_type(L, 2) != LUA_TNUMBER) {
|
||||||
quad = luaobj_checkudata(L, 2, LUAOBJ_TYPE_QUAD);
|
quad = luaobj_checkudata(L, 2, LUAOBJ_TYPE_QUAD);
|
||||||
x = luaL_checkint(L, 3);
|
x = luaL_optint(L, 3, 0);
|
||||||
y = luaL_checkint(L, 4);
|
y = luaL_optint(L, 4, 0);
|
||||||
} else {
|
} else {
|
||||||
x = luaL_checkint(L, 2);
|
x = luaL_optint(L, 2, 0);
|
||||||
y = luaL_checkint(L, 3);
|
y = luaL_optint(L, 3, 0);
|
||||||
}
|
}
|
||||||
pixel_t *buf = graphics_canvas->data;
|
pixel_t *buf = graphics_canvas->data;
|
||||||
int bufw = graphics_canvas->width;
|
int bufw = graphics_canvas->width;
|
||||||
|
|||||||
Reference in New Issue
Block a user