mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Renamed World:setAllowSleeping and World:getAllowSleeping to World:setSleepingAllowed and World:isSleepingAllowed (see issue #691, also consistent with the Body methods)
This commit is contained in:
@@ -396,12 +396,12 @@ int World::getGravity(lua_State *L)
|
||||
return 2;
|
||||
}
|
||||
|
||||
void World::setAllowSleeping(bool allow)
|
||||
void World::setSleepingAllowed(bool allow)
|
||||
{
|
||||
world->SetAllowSleeping(allow);
|
||||
}
|
||||
|
||||
bool World::getAllowSleeping() const
|
||||
bool World::isSleepingAllowed() const
|
||||
{
|
||||
return world->GetAllowSleeping();
|
||||
}
|
||||
|
||||
@@ -185,13 +185,13 @@ public:
|
||||
* Sets whether this World allows sleep.
|
||||
* @param allow True to allow, false to disallow.
|
||||
**/
|
||||
void setAllowSleeping(bool allow);
|
||||
void setSleepingAllowed(bool allow);
|
||||
|
||||
/**
|
||||
* Returns whether this World allows sleep.
|
||||
* @return True if allowed, false if disallowed.
|
||||
**/
|
||||
bool getAllowSleeping() const;
|
||||
bool isSleepingAllowed() const;
|
||||
|
||||
/**
|
||||
* Returns whether this World is currently locked.
|
||||
|
||||
@@ -87,18 +87,18 @@ int w_World_getGravity(lua_State *L)
|
||||
return t->getGravity(L);
|
||||
}
|
||||
|
||||
int w_World_setAllowSleeping(lua_State *L)
|
||||
int w_World_setSleepingAllowed(lua_State *L)
|
||||
{
|
||||
World *t = luax_checkworld(L, 1);
|
||||
bool b = luax_toboolean(L, 2);
|
||||
t->setAllowSleeping(b);
|
||||
t->setSleepingAllowed(b);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_World_getAllowSleeping(lua_State *L)
|
||||
int w_World_isSleepingAllowed(lua_State *L)
|
||||
{
|
||||
World *t = luax_checkworld(L, 1);
|
||||
luax_pushboolean(L, t->getAllowSleeping());
|
||||
luax_pushboolean(L, t->isSleepingAllowed());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -189,8 +189,8 @@ static const luaL_Reg functions[] =
|
||||
{ "getContactFilter", w_World_getContactFilter },
|
||||
{ "setGravity", w_World_setGravity },
|
||||
{ "getGravity", w_World_getGravity },
|
||||
{ "setAllowSleeping", w_World_setAllowSleeping },
|
||||
{ "getAllowSleeping", w_World_getAllowSleeping },
|
||||
{ "setSleepingAllowed", w_World_setSleepingAllowed },
|
||||
{ "isSleepingAllowed", w_World_isSleepingAllowed },
|
||||
{ "isLocked", w_World_isLocked },
|
||||
{ "getBodyCount", w_World_getBodyCount },
|
||||
{ "getJointCount", w_World_getJointCount },
|
||||
|
||||
@@ -42,8 +42,8 @@ int w_World_setContactFilter(lua_State *L);
|
||||
int w_World_getContactFilter(lua_State *L);
|
||||
int w_World_setGravity(lua_State *L);
|
||||
int w_World_getGravity(lua_State *L);
|
||||
int w_World_setAllowSleeping(lua_State *L);
|
||||
int w_World_getAllowSleeping(lua_State *L);
|
||||
int w_World_setSleepingAllowed(lua_State *L);
|
||||
int w_World_isSleepingAllowed(lua_State *L);
|
||||
int w_World_isLocked(lua_State *L);
|
||||
int w_World_getBodyCount(lua_State *L);
|
||||
int w_World_getJointCount(lua_State *L);
|
||||
|
||||
Reference in New Issue
Block a user