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:
Bart van Strien
2017-09-13 15:48:53 +02:00
parent 7dae80f552
commit 23929cab14
6 changed files with 77 additions and 30 deletions
+33 -9
View File
@@ -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 }
};