mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Avoid luaL_checkint and luaL_optint, they're not available in Lua 5.4.
Fixes #2102.
This commit is contained in:
@@ -163,10 +163,10 @@ int w_ImageData_mapPixel(lua_State *L)
|
||||
ImageData *t = luax_checkimagedata(L, 1);
|
||||
luaL_checktype(L, 2, LUA_TFUNCTION);
|
||||
|
||||
int sx = luaL_optint(L, 3, 0);
|
||||
int sy = luaL_optint(L, 4, 0);
|
||||
int w = luaL_optint(L, 5, t->getWidth());
|
||||
int h = luaL_optint(L, 6, t->getHeight());
|
||||
int sx = luax_optint(L, 3, 0);
|
||||
int sy = luax_optint(L, 4, 0);
|
||||
int w = luax_optint(L, 5, t->getWidth());
|
||||
int h = luax_optint(L, 6, t->getHeight());
|
||||
|
||||
if (!(t->inside(sx, sy) && t->inside(sx+w-1, sy+h-1)))
|
||||
return luaL_error(L, "Invalid rectangle dimensions.");
|
||||
|
||||
Reference in New Issue
Block a user