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
@@ -55,7 +55,7 @@ int w_ChainShape_setPreviousVertex(lua_State *L)
int w_ChainShape_getChildEdge(lua_State *L)
{
ChainShape *c = luax_checkchainshape(L, 1);
int index = luaL_checkint(L, 2) - 1; // Convert from 1-based index
int index = (int) luaL_checknumber(L, 2) - 1; // Convert from 1-based index
EdgeShape *e = 0;
luax_catchexcept(L, [&](){ e = c->getChildEdge(index); });
luax_pushtype(L, PHYSICS_EDGE_SHAPE_ID, e);
@@ -74,7 +74,7 @@ int w_ChainShape_getVertexCount(lua_State *L)
int w_ChainShape_getPoint(lua_State *L)
{
ChainShape *c = luax_checkchainshape(L, 1);
int index = luaL_checkint(L, 2) - 1; // Convert from 1-based index
int index = (int) luaL_checknumber(L, 2) - 1; // Convert from 1-based index
b2Vec2 v;
luax_catchexcept(L, [&](){ v = c->getPoint(index); });
lua_pushnumber(L, v.x);