diff --git a/platform/msvc2008/love.vcproj b/platform/msvc2008/love.vcproj index 62c2d83ae..3c6719106 100644 --- a/platform/msvc2008/love.vcproj +++ b/platform/msvc2008/love.vcproj @@ -61,7 +61,7 @@ /> release(); + return 0; + } + static const luaL_Reg functions[] = { { "getX", w_Body_getX }, { "getY", w_Body_getY }, @@ -439,6 +446,7 @@ namespace box2d { "setAllowSleeping", w_Body_setAllowSleeping }, { "putToSleep", w_Body_putToSleep }, { "wakeUp", w_Body_wakeUp }, + { "destroy", w_Body_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_Body.h b/src/modules/physics/box2d/wrap_Body.h index 50463d987..d566d7a12 100644 --- a/src/modules/physics/box2d/wrap_Body.h +++ b/src/modules/physics/box2d/wrap_Body.h @@ -73,6 +73,7 @@ namespace box2d int w_Body_setAllowSleeping(lua_State * L); int w_Body_putToSleep(lua_State * L); int w_Body_wakeUp(lua_State * L); + int w_Body_destroy(lua_State * L); int luaopen_body(lua_State * L); } // box2d diff --git a/src/modules/physics/box2d/wrap_CircleShape.cpp b/src/modules/physics/box2d/wrap_CircleShape.cpp index 7c305387b..49a64959b 100644 --- a/src/modules/physics/box2d/wrap_CircleShape.cpp +++ b/src/modules/physics/box2d/wrap_CircleShape.cpp @@ -61,6 +61,7 @@ namespace box2d { "setData", w_Shape_setData }, { "getData", w_Shape_getData }, { "getBoundingBox", w_Shape_getBoundingBox }, + { "destroy", w_Shape_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_DistanceJoint.cpp b/src/modules/physics/box2d/wrap_DistanceJoint.cpp index 52e80b7c4..ceb2e506a 100644 --- a/src/modules/physics/box2d/wrap_DistanceJoint.cpp +++ b/src/modules/physics/box2d/wrap_DistanceJoint.cpp @@ -90,6 +90,7 @@ namespace box2d { "getReactionTorque", w_Joint_getReactionTorque }, { "setCollideConnected", w_Joint_setCollideConnected }, { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_GearJoint.cpp b/src/modules/physics/box2d/wrap_GearJoint.cpp index 0afb98db0..41f8f30ea 100644 --- a/src/modules/physics/box2d/wrap_GearJoint.cpp +++ b/src/modules/physics/box2d/wrap_GearJoint.cpp @@ -56,6 +56,7 @@ namespace box2d { "getReactionTorque", w_Joint_getReactionTorque }, { "setCollideConnected", w_Joint_setCollideConnected }, { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_Joint.cpp b/src/modules/physics/box2d/wrap_Joint.cpp index 15f04f510..580b40425 100644 --- a/src/modules/physics/box2d/wrap_Joint.cpp +++ b/src/modules/physics/box2d/wrap_Joint.cpp @@ -78,6 +78,13 @@ namespace box2d return 1; } + int w_Joint_destroy(lua_State * L) + { + Joint * t = luax_checkjoint(L, 1); + t->release(); + return 0; + } + static const luaL_Reg functions[] = { { "getType", w_Joint_getType }, { "getAnchors", w_Joint_getAnchors }, @@ -85,6 +92,7 @@ namespace box2d { "getReactionTorque", w_Joint_getReactionTorque }, { "setCollideConnected", w_Joint_setCollideConnected }, { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_Joint.h b/src/modules/physics/box2d/wrap_Joint.h index 0b999ecec..063d9a9d9 100644 --- a/src/modules/physics/box2d/wrap_Joint.h +++ b/src/modules/physics/box2d/wrap_Joint.h @@ -38,6 +38,7 @@ namespace box2d int w_Joint_getReactionTorque(lua_State * L); int w_Joint_setCollideConnected(lua_State * L); int w_Joint_getCollideConnected(lua_State * L); + int w_Joint_destroy(lua_State * L); int luaopen_joint(lua_State * L); } // box2d diff --git a/src/modules/physics/box2d/wrap_MouseJoint.cpp b/src/modules/physics/box2d/wrap_MouseJoint.cpp index 65e929d0f..82a2a94fd 100644 --- a/src/modules/physics/box2d/wrap_MouseJoint.cpp +++ b/src/modules/physics/box2d/wrap_MouseJoint.cpp @@ -74,6 +74,7 @@ namespace box2d { "getReactionTorque", w_Joint_getReactionTorque }, { "setCollideConnected", w_Joint_setCollideConnected }, { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_PolygonShape.cpp b/src/modules/physics/box2d/wrap_PolygonShape.cpp index bd8173bbc..1127a1bce 100644 --- a/src/modules/physics/box2d/wrap_PolygonShape.cpp +++ b/src/modules/physics/box2d/wrap_PolygonShape.cpp @@ -61,6 +61,7 @@ namespace box2d { "setData", w_Shape_setData }, { "getData", w_Shape_getData }, { "getBoundingBox", w_Shape_getBoundingBox }, + { "destroy", w_Shape_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_PrismaticJoint.cpp b/src/modules/physics/box2d/wrap_PrismaticJoint.cpp index 9fadb8dfb..22eccadbc 100644 --- a/src/modules/physics/box2d/wrap_PrismaticJoint.cpp +++ b/src/modules/physics/box2d/wrap_PrismaticJoint.cpp @@ -183,6 +183,7 @@ namespace box2d { "getReactionTorque", w_Joint_getReactionTorque }, { "setCollideConnected", w_Joint_setCollideConnected }, { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_PulleyJoint.cpp b/src/modules/physics/box2d/wrap_PulleyJoint.cpp index b7d8bc60e..a33b89889 100644 --- a/src/modules/physics/box2d/wrap_PulleyJoint.cpp +++ b/src/modules/physics/box2d/wrap_PulleyJoint.cpp @@ -115,6 +115,7 @@ namespace box2d { "getReactionTorque", w_Joint_getReactionTorque }, { "setCollideConnected", w_Joint_setCollideConnected }, { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_RevoluteJoint.cpp b/src/modules/physics/box2d/wrap_RevoluteJoint.cpp index fbd0bd2fc..8c90f5729 100644 --- a/src/modules/physics/box2d/wrap_RevoluteJoint.cpp +++ b/src/modules/physics/box2d/wrap_RevoluteJoint.cpp @@ -183,6 +183,7 @@ namespace box2d { "getReactionTorque", w_Joint_getReactionTorque }, { "setCollideConnected", w_Joint_setCollideConnected }, { "getCollideConnected", w_Joint_getCollideConnected }, + { "destroy", w_Joint_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_Shape.cpp b/src/modules/physics/box2d/wrap_Shape.cpp index 92e6a43fd..b6ee80f07 100644 --- a/src/modules/physics/box2d/wrap_Shape.cpp +++ b/src/modules/physics/box2d/wrap_Shape.cpp @@ -198,6 +198,13 @@ namespace box2d return t->getBoundingBox(L); } + int w_Shape_destroy(lua_State * L) + { + Shape * t = luax_checkshape(L, 1); + t->release(); + return 0; + } + static const luaL_Reg functions[] = { { "getType", w_Shape_getType }, { "setFriction", w_Shape_setFriction }, @@ -219,6 +226,7 @@ namespace box2d { "setData", w_Shape_setData }, { "getData", w_Shape_getData }, { "getBoundingBox", w_Shape_getBoundingBox }, + { "destroy", w_Shape_destroy }, { 0, 0 } }; diff --git a/src/modules/physics/box2d/wrap_Shape.h b/src/modules/physics/box2d/wrap_Shape.h index 32fac8eb2..c102e4ff9 100644 --- a/src/modules/physics/box2d/wrap_Shape.h +++ b/src/modules/physics/box2d/wrap_Shape.h @@ -53,6 +53,7 @@ namespace box2d int w_Shape_setData(lua_State * L); int w_Shape_getData(lua_State * L); int w_Shape_getBoundingBox(lua_State * L); + int w_Shape_destroy(lua_State * L); int luaopen_shape(lua_State * L); } // box2d