mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
love.physics: simplify Body and Shape API.
#1130 - Shapes are now directly attached to Bodies when they're created (similar to love 0.7 and older). - Fixtures are removed. - All methods that were in Fixtures now exist in Shapes. - All APIs that used or returned a Fixture now do the same with a Shape. - Add new love.physics.new*Shape variants that take a Body as the first parameter. - Deprecate the new*Shape APIs that don't take a Body. - Deprecate love.physics.newFixture (the deprecated function now returns a Shape). - Replace Body:getFixture and Body:getFixtures with Body:getShape and Body:getShapes (Body:getFixtures is deprecated). - Replace World:queryFixturesInArea and World:getFixturesInArea with World:queryShapesInArea and World:getShapesInArea (queryFixturesInArea is deprecated). - Replace Contact:getFixtures with Contact:getShapes (Contact:getFixtures is deprecated). - Replace all love.physics callback Fixture parameters with Shape parameters. - Deprecate ChainShape:getChildEdge.
This commit is contained in:
@@ -107,8 +107,12 @@ std::string getDeprecationNotice(const DeprecationInfo &info, bool usewhere)
|
||||
|
||||
if (info.apiType == API_FUNCTION)
|
||||
notice << "function ";
|
||||
else if (info.apiType == API_FUNCTION_VARIANT)
|
||||
notice << "function variant in ";
|
||||
else if (info.apiType == API_METHOD)
|
||||
notice << "method ";
|
||||
else if (info.apiType == API_METHOD_VARIANT)
|
||||
notice << "method variant in ";
|
||||
else if (info.apiType == API_CALLBACK)
|
||||
notice << "callback ";
|
||||
else if (info.apiType == API_FIELD)
|
||||
@@ -188,7 +192,9 @@ MarkDeprecated::~MarkDeprecated()
|
||||
STRINGMAP_BEGIN(APIType, API_MAX_ENUM, apiType)
|
||||
{
|
||||
{ "function", API_FUNCTION },
|
||||
{ "functionvariant", API_FUNCTION_VARIANT },
|
||||
{ "method", API_METHOD },
|
||||
{ "methodvariant", API_METHOD_VARIANT },
|
||||
{ "callback", API_CALLBACK },
|
||||
{ "field", API_FIELD },
|
||||
{ "constant", API_CONSTANT },
|
||||
|
||||
@@ -32,7 +32,9 @@ namespace love
|
||||
enum APIType
|
||||
{
|
||||
API_FUNCTION,
|
||||
API_FUNCTION_VARIANT,
|
||||
API_METHOD,
|
||||
API_METHOD_VARIANT,
|
||||
API_CALLBACK,
|
||||
API_FIELD,
|
||||
API_CONSTANT,
|
||||
|
||||
Reference in New Issue
Block a user