mirror of
https://github.com/love2d/love.git
synced 2026-08-16 16:20:42 +02:00
Restored the destroy method for objects in love.physics.
This commit is contained in:
@@ -398,6 +398,13 @@ namespace box2d
|
||||
return 0;
|
||||
}
|
||||
|
||||
int w_Body_destroy(lua_State * L)
|
||||
{
|
||||
Body * t = luax_checkbody(L, 1);
|
||||
t->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 }
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -61,6 +61,7 @@ namespace box2d
|
||||
{ "setData", w_Shape_setData },
|
||||
{ "getData", w_Shape_getData },
|
||||
{ "getBoundingBox", w_Shape_getBoundingBox },
|
||||
{ "destroy", w_Shape_destroy },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ namespace box2d
|
||||
{ "getReactionTorque", w_Joint_getReactionTorque },
|
||||
{ "setCollideConnected", w_Joint_setCollideConnected },
|
||||
{ "getCollideConnected", w_Joint_getCollideConnected },
|
||||
{ "destroy", w_Joint_destroy },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace box2d
|
||||
{ "getReactionTorque", w_Joint_getReactionTorque },
|
||||
{ "setCollideConnected", w_Joint_setCollideConnected },
|
||||
{ "getCollideConnected", w_Joint_getCollideConnected },
|
||||
{ "destroy", w_Joint_destroy },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -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 }
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -74,6 +74,7 @@ namespace box2d
|
||||
{ "getReactionTorque", w_Joint_getReactionTorque },
|
||||
{ "setCollideConnected", w_Joint_setCollideConnected },
|
||||
{ "getCollideConnected", w_Joint_getCollideConnected },
|
||||
{ "destroy", w_Joint_destroy },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ namespace box2d
|
||||
{ "setData", w_Shape_setData },
|
||||
{ "getData", w_Shape_getData },
|
||||
{ "getBoundingBox", w_Shape_getBoundingBox },
|
||||
{ "destroy", w_Shape_destroy },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -183,6 +183,7 @@ namespace box2d
|
||||
{ "getReactionTorque", w_Joint_getReactionTorque },
|
||||
{ "setCollideConnected", w_Joint_setCollideConnected },
|
||||
{ "getCollideConnected", w_Joint_getCollideConnected },
|
||||
{ "destroy", w_Joint_destroy },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ namespace box2d
|
||||
{ "getReactionTorque", w_Joint_getReactionTorque },
|
||||
{ "setCollideConnected", w_Joint_setCollideConnected },
|
||||
{ "getCollideConnected", w_Joint_getCollideConnected },
|
||||
{ "destroy", w_Joint_destroy },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -183,6 +183,7 @@ namespace box2d
|
||||
{ "getReactionTorque", w_Joint_getReactionTorque },
|
||||
{ "setCollideConnected", w_Joint_setCollideConnected },
|
||||
{ "getCollideConnected", w_Joint_getCollideConnected },
|
||||
{ "destroy", w_Joint_destroy },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -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 }
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user