mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Fix Fixture:getShape(), for real this time.
All the Memoizer stuff was pointless: when you create a Fixture, it clones the b2Shape, so there was never going to be a memoized Shape to find. And cloning the Shape is incorrect as well, since you should able to modify the Shape retrieved through getShape and have it affect the Fixture. Everything's much simpler now.
This commit is contained in:
@@ -126,15 +126,8 @@ namespace box2d
|
||||
{
|
||||
if (!fixture->GetShape())
|
||||
return NULL;
|
||||
Shape * s = (Shape *)Memoizer::find(fixture->GetShape());
|
||||
if (!s)
|
||||
{
|
||||
b2BlockAllocator a;
|
||||
s = new Shape(fixture->GetShape()->Clone(&a));
|
||||
}
|
||||
else
|
||||
s->retain();
|
||||
return s;
|
||||
|
||||
return new Shape(fixture->GetShape(), false);
|
||||
}
|
||||
|
||||
bool Fixture::isValid() const
|
||||
|
||||
Reference in New Issue
Block a user