diff --git a/src/modules/physics/box2d/PrismaticJoint.cpp b/src/modules/physics/box2d/PrismaticJoint.cpp index d73c01bd4..40587f35d 100644 --- a/src/modules/physics/box2d/PrismaticJoint.cpp +++ b/src/modules/physics/box2d/PrismaticJoint.cpp @@ -117,7 +117,7 @@ void PrismaticJoint::setLimitsEnabled(bool enable) joint->EnableLimit(enable); } -bool PrismaticJoint::hasLimitsEnabled() const +bool PrismaticJoint::areLimitsEnabled() const { return joint->IsLimitEnabled(); } diff --git a/src/modules/physics/box2d/PrismaticJoint.h b/src/modules/physics/box2d/PrismaticJoint.h index 1f9bc5d5e..854bfcb54 100644 --- a/src/modules/physics/box2d/PrismaticJoint.h +++ b/src/modules/physics/box2d/PrismaticJoint.h @@ -104,7 +104,7 @@ public: /** * Checks whether limits are enabled. **/ - bool hasLimitsEnabled() const; + bool areLimitsEnabled() const; /** * Sets the upper limit, usually in meters. diff --git a/src/modules/physics/box2d/RevoluteJoint.cpp b/src/modules/physics/box2d/RevoluteJoint.cpp index 5d61c193c..2bee5cdd7 100644 --- a/src/modules/physics/box2d/RevoluteJoint.cpp +++ b/src/modules/physics/box2d/RevoluteJoint.cpp @@ -116,7 +116,7 @@ void RevoluteJoint::setLimitsEnabled(bool enable) joint->EnableLimit(enable); } -bool RevoluteJoint::hasLimitsEnabled() const +bool RevoluteJoint::areLimitsEnabled() const { return joint->IsLimitEnabled(); } diff --git a/src/modules/physics/box2d/RevoluteJoint.h b/src/modules/physics/box2d/RevoluteJoint.h index 66dcfd222..d7619c213 100644 --- a/src/modules/physics/box2d/RevoluteJoint.h +++ b/src/modules/physics/box2d/RevoluteJoint.h @@ -104,7 +104,7 @@ public: /** * Checks whether limits are enabled. **/ - bool hasLimitsEnabled() const; + bool areLimitsEnabled() const; /** * Sets the upper limit in degrees. diff --git a/src/modules/physics/box2d/wrap_PrismaticJoint.cpp b/src/modules/physics/box2d/wrap_PrismaticJoint.cpp index 9ea26d352..977edae1f 100644 --- a/src/modules/physics/box2d/wrap_PrismaticJoint.cpp +++ b/src/modules/physics/box2d/wrap_PrismaticJoint.cpp @@ -111,10 +111,10 @@ int w_PrismaticJoint_setLimitsEnabled(lua_State *L) return 0; } -int w_PrismaticJoint_hasLimitsEnabled(lua_State *L) +int w_PrismaticJoint_areLimitsEnabled(lua_State *L) { PrismaticJoint *t = luax_checkprismaticjoint(L, 1); - luax_pushboolean(L, t->hasLimitsEnabled()); + luax_pushboolean(L, t->areLimitsEnabled()); return 1; } @@ -178,6 +178,12 @@ int w_PrismaticJoint_getReferenceAngle(lua_State *L) return 1; } +int w_PrismaticJoint_hasLimitsEnabled(lua_State *L) +{ + luax_markdeprecated(L, "PrismaticJoint:hasLimitsEnabled", DEPRECATED_RENAMED, "PrismaticJoint:areLimitsEnabled"); + return w_PrismaticJoint_areLimitsEnabled(L); +} + static const luaL_Reg w_PrismaticJoint_functions[] = { { "getJointTranslation", w_PrismaticJoint_getJointTranslation }, @@ -190,7 +196,7 @@ static const luaL_Reg w_PrismaticJoint_functions[] = { "getMotorForce", w_PrismaticJoint_getMotorForce }, { "getMaxMotorForce", w_PrismaticJoint_getMaxMotorForce }, { "setLimitsEnabled", w_PrismaticJoint_setLimitsEnabled }, - { "hasLimitsEnabled", w_PrismaticJoint_hasLimitsEnabled }, + { "areLimitsEnabled", w_PrismaticJoint_areLimitsEnabled }, { "setUpperLimit", w_PrismaticJoint_setUpperLimit }, { "setLowerLimit", w_PrismaticJoint_setLowerLimit }, { "setLimits", w_PrismaticJoint_setLimits }, @@ -199,6 +205,10 @@ static const luaL_Reg w_PrismaticJoint_functions[] = { "getLimits", w_PrismaticJoint_getLimits }, { "getAxis", w_PrismaticJoint_getAxis }, { "getReferenceAngle", w_PrismaticJoint_getReferenceAngle }, + + // Deprecated + { "hasLimitsEnabled", w_PrismaticJoint_hasLimitsEnabled }, + { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_RevoluteJoint.cpp b/src/modules/physics/box2d/wrap_RevoluteJoint.cpp index 62124f8b8..4e10de4cf 100644 --- a/src/modules/physics/box2d/wrap_RevoluteJoint.cpp +++ b/src/modules/physics/box2d/wrap_RevoluteJoint.cpp @@ -111,10 +111,10 @@ int w_RevoluteJoint_setLimitsEnabled(lua_State *L) return 0; } -int w_RevoluteJoint_hasLimitsEnabled(lua_State *L) +int w_RevoluteJoint_areLimitsEnabled(lua_State *L) { RevoluteJoint *t = luax_checkrevolutejoint(L, 1); - luax_pushboolean(L, t->hasLimitsEnabled()); + luax_pushboolean(L, t->areLimitsEnabled()); return 1; } @@ -171,6 +171,12 @@ int w_RevoluteJoint_getReferenceAngle(lua_State *L) return 1; } +int w_RevoluteJoint_hasLimitsEnabled(lua_State *L) +{ + luax_markdeprecated(L, "RevoluteJoint:hasLimitsEnabled", DEPRECATED_RENAMED, "RevoluteJoint:areLimitsEnabled"); + return w_RevoluteJoint_areLimitsEnabled(L); +} + static const luaL_Reg w_RevoluteJoint_functions[] = { { "getJointAngle", w_RevoluteJoint_getJointAngle }, @@ -183,7 +189,7 @@ static const luaL_Reg w_RevoluteJoint_functions[] = { "getMotorTorque", w_RevoluteJoint_getMotorTorque }, { "getMaxMotorTorque", w_RevoluteJoint_getMaxMotorTorque }, { "setLimitsEnabled", w_RevoluteJoint_setLimitsEnabled }, - { "hasLimitsEnabled", w_RevoluteJoint_hasLimitsEnabled }, + { "areLimitsEnabled", w_RevoluteJoint_areLimitsEnabled }, { "setUpperLimit", w_RevoluteJoint_setUpperLimit }, { "setLowerLimit", w_RevoluteJoint_setLowerLimit }, { "setLimits", w_RevoluteJoint_setLimits }, @@ -191,6 +197,10 @@ static const luaL_Reg w_RevoluteJoint_functions[] = { "getUpperLimit", w_RevoluteJoint_getUpperLimit }, { "getLimits", w_RevoluteJoint_getLimits }, { "getReferenceAngle", w_RevoluteJoint_getReferenceAngle }, + + // Deprecated + { "hasLimitsEnabled", w_RevoluteJoint_hasLimitsEnabled }, + { 0, 0 } }; diff --git a/src/modules/sound/wrap_Sound.cpp b/src/modules/sound/wrap_Sound.cpp index 49a13e865..5195ed6df 100644 --- a/src/modules/sound/wrap_Sound.cpp +++ b/src/modules/sound/wrap_Sound.cpp @@ -53,7 +53,7 @@ int w_newDecoder(lua_State *L) int w_newSoundData(lua_State *L) { - SoundData *t = 0; + SoundData *t = nullptr; if (lua_isnumber(L, 1)) {