mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Make second argument to setDefaultImageFilter Image:setFilter and Image:setWrap optional, and default to the first
This commit is contained in:
@@ -589,7 +589,7 @@ int w_setDefaultImageFilter(lua_State *L)
|
||||
Image::FilterMode min;
|
||||
Image::FilterMode mag;
|
||||
const char *minstr = luaL_checkstring(L, 1);
|
||||
const char *magstr = luaL_checkstring(L, 2);
|
||||
const char *magstr = luaL_optstring(L, 2, minstr);
|
||||
if (!Image::getConstant(minstr, min))
|
||||
return luaL_error(L, "Invalid filter mode: %s", minstr);
|
||||
if (!Image::getConstant(magstr, mag))
|
||||
|
||||
@@ -54,7 +54,7 @@ int w_Image_setFilter(lua_State *L)
|
||||
Image::FilterMode min;
|
||||
Image::FilterMode mag;
|
||||
const char *minstr = luaL_checkstring(L, 2);
|
||||
const char *magstr = luaL_checkstring(L, 3);
|
||||
const char *magstr = luaL_optstring(L, 3, minstr);
|
||||
if (!Image::getConstant(minstr, min))
|
||||
return luaL_error(L, "Invalid filter mode: %s", minstr);
|
||||
if (!Image::getConstant(magstr, mag))
|
||||
@@ -88,7 +88,7 @@ int w_Image_setWrap(lua_State *L)
|
||||
Image::WrapMode s;
|
||||
Image::WrapMode t;
|
||||
const char *sstr = luaL_checkstring(L, 2);
|
||||
const char *tstr = luaL_checkstring(L, 3);
|
||||
const char *tstr = luaL_optstring(L, 3, sstr);
|
||||
if (!Image::getConstant(sstr, s))
|
||||
return luaL_error(L, "Invalid wrap mode: %s", sstr);
|
||||
if (!Image::getConstant(tstr, t))
|
||||
|
||||
Reference in New Issue
Block a user