love.physics: move internal box2d->love object map to World instances, and clean up some physics object code. Resolves issue #1465.

This commit is contained in:
Alex Szpakowski
2019-01-04 21:36:05 -04:00
parent 0752f27bdf
commit 3ad16a70da
20 changed files with 103 additions and 215 deletions
-7
View File
@@ -25,8 +25,6 @@
#include "World.h"
#include "Physics.h"
#include "common/Memoizer.h"
// STD
#include <bitset>
@@ -47,17 +45,12 @@ Shape::Shape(b2Shape *shape, bool own)
: shape(shape)
, own(own)
{
if (own)
Memoizer::add(shape, this);
}
Shape::~Shape()
{
if (shape && own)
{
Memoizer::remove(shape);
delete shape;
}
shape = nullptr;
}