mirror of https://github.com/bjornbytes/lovr.git
Add Collider:getShapes for backcompat;
This commit is contained in:
parent
17fa3d1f7b
commit
e2fdba6f24
|
@ -520,6 +520,16 @@ static int l_lovrColliderSetTag(lua_State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Deprecated
|
||||
static int l_lovrColliderGetShapes(lua_State* L) {
|
||||
Collider* collider = luax_checktype(L, 1, Collider);
|
||||
Shape* shape = lovrColliderGetShape(collider);
|
||||
lua_createtable(L, 1, 0);
|
||||
luax_pushshape(L, shape);
|
||||
lua_rawseti(L, -2, 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const luaL_Reg lovrCollider[] = {
|
||||
{ "destroy", l_lovrColliderDestroy },
|
||||
{ "isDestroyed", l_lovrColliderIsDestroyed },
|
||||
|
@ -573,5 +583,9 @@ const luaL_Reg lovrCollider[] = {
|
|||
{ "setRestitution", l_lovrColliderSetRestitution },
|
||||
{ "getTag", l_lovrColliderGetTag },
|
||||
{ "setTag", l_lovrColliderSetTag },
|
||||
|
||||
// Deprecated
|
||||
{ "getShapes", l_lovrColliderGetShapes },
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue