mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Rename love.physics getObjectList functions to getObjects (resolves #1305)
World:getBodyList -> World:getBodies World:getContactList -> World:getContacts World:getJointList -> World:getJoints Body:getFixtureList -> Body:getFixtures Body:getContactList -> Body:getContacts Body:getJointList -> Body:getJoints Marked the old functions as deprecated --HG-- branch : minor
This commit is contained in:
@@ -530,30 +530,30 @@ int w_Body_getWorld(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_Body_getFixtureList(lua_State *L)
|
||||
int w_Body_getFixtures(lua_State *L)
|
||||
{
|
||||
Body *t = luax_checkbody(L, 1);
|
||||
lua_remove(L, 1);
|
||||
int n = 0;
|
||||
luax_catchexcept(L, [&](){ n = t->getFixtureList(L); });
|
||||
luax_catchexcept(L, [&](){ n = t->getFixtures(L); });
|
||||
return n;
|
||||
}
|
||||
|
||||
int w_Body_getJointList(lua_State *L)
|
||||
int w_Body_getJoints(lua_State *L)
|
||||
{
|
||||
Body *t = luax_checkbody(L, 1);
|
||||
lua_remove(L, 1);
|
||||
int n = 0;
|
||||
luax_catchexcept(L, [&](){ n = t->getJointList(L); });
|
||||
luax_catchexcept(L, [&](){ n = t->getJoints(L); });
|
||||
return n;
|
||||
}
|
||||
|
||||
int w_Body_getContactList(lua_State *L)
|
||||
int w_Body_getContacts(lua_State *L)
|
||||
{
|
||||
Body *t = luax_checkbody(L, 1);
|
||||
lua_remove(L, 1);
|
||||
int n = 0;
|
||||
luax_catchexcept(L, [&](){ n = t->getContactList(L); });
|
||||
luax_catchexcept(L, [&](){ n = t->getContacts(L); });
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -585,6 +585,24 @@ int w_Body_getUserData(lua_State *L)
|
||||
return t->getUserData(L);
|
||||
}
|
||||
|
||||
int w_Body_getFixtureList(lua_State *L)
|
||||
{
|
||||
luax_markdeprecated(L, "Body:getFixtureList", API_METHOD, DEPRECATED_RENAMED, "Body:getFixtures");
|
||||
return w_Body_getFixtures(L);
|
||||
}
|
||||
|
||||
int w_Body_getJointList(lua_State *L)
|
||||
{
|
||||
luax_markdeprecated(L, "Body:getJointList", API_METHOD, DEPRECATED_RENAMED, "Body:getJoints");
|
||||
return w_Body_getJoints(L);
|
||||
}
|
||||
|
||||
int w_Body_getContactList(lua_State *L)
|
||||
{
|
||||
luax_markdeprecated(L, "Body:getContactList", API_METHOD, DEPRECATED_RENAMED, "Body:getContacts");
|
||||
return w_Body_getContacts(L);
|
||||
}
|
||||
|
||||
static const luaL_Reg w_Body_functions[] =
|
||||
{
|
||||
{ "getX", w_Body_getX },
|
||||
@@ -638,13 +656,19 @@ static const luaL_Reg w_Body_functions[] =
|
||||
{ "setFixedRotation", w_Body_setFixedRotation },
|
||||
{ "isFixedRotation", w_Body_isFixedRotation },
|
||||
{ "getWorld", w_Body_getWorld },
|
||||
{ "getFixtureList", w_Body_getFixtureList },
|
||||
{ "getJointList", w_Body_getJointList },
|
||||
{ "getContactList", w_Body_getContactList },
|
||||
{ "getFixtures", w_Body_getFixtures },
|
||||
{ "getJoints", w_Body_getJoints },
|
||||
{ "getContacts", w_Body_getContacts },
|
||||
{ "destroy", w_Body_destroy },
|
||||
{ "isDestroyed", w_Body_isDestroyed },
|
||||
{ "setUserData", w_Body_setUserData },
|
||||
{ "getUserData", w_Body_getUserData },
|
||||
|
||||
// Deprectaed
|
||||
{ "getFixtureList", w_Body_getFixtureList },
|
||||
{ "getJointList", w_Body_getJointList },
|
||||
{ "getContactList", w_Body_getContactList },
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user