mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Add basic lua 5.3 support
This commit is contained in:
@@ -34,7 +34,7 @@ CompressedImageData *luax_checkcompressedimagedata(lua_State *L, int idx)
|
||||
int w_CompressedImageData_getWidth(lua_State *L)
|
||||
{
|
||||
CompressedImageData *t = luax_checkcompressedimagedata(L, 1);
|
||||
int miplevel = luaL_optint(L, 2, 1);
|
||||
int miplevel = (int) luaL_optnumber(L, 2, 1);
|
||||
int width = 0;
|
||||
|
||||
luax_catchexcept(L, [&](){ width = t->getWidth(miplevel - 1); });
|
||||
@@ -46,7 +46,7 @@ int w_CompressedImageData_getWidth(lua_State *L)
|
||||
int w_CompressedImageData_getHeight(lua_State *L)
|
||||
{
|
||||
CompressedImageData *t = luax_checkcompressedimagedata(L, 1);
|
||||
int miplevel = luaL_optint(L, 2, 1);
|
||||
int miplevel = (int) luaL_optnumber(L, 2, 1);
|
||||
int height = 0;
|
||||
|
||||
luax_catchexcept(L, [&](){ height = t->getHeight(miplevel - 1); });
|
||||
@@ -58,7 +58,7 @@ int w_CompressedImageData_getHeight(lua_State *L)
|
||||
int w_CompressedImageData_getDimensions(lua_State *L)
|
||||
{
|
||||
CompressedImageData *t = luax_checkcompressedimagedata(L, 1);
|
||||
int miplevel = luaL_optint(L, 2, 1);
|
||||
int miplevel = (int) luaL_optnumber(L, 2, 1);
|
||||
int width = 0, height = 0;
|
||||
|
||||
luax_catchexcept(L, [&]()
|
||||
|
||||
Reference in New Issue
Block a user