Add basic lua 5.3 support

This commit is contained in:
Bart van Strien
2015-06-16 10:25:41 +02:00
parent df1bd42dec
commit 3cb777e2b7
39 changed files with 252 additions and 187 deletions
@@ -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, [&]()