mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
First attempt at implementing Memoization for certain Box2D objects
--HG-- branch : box2d-update
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include "World.h"
|
||||
#include "Physics.h"
|
||||
|
||||
#include <common/Memoizer.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
namespace physics
|
||||
@@ -34,10 +36,12 @@ namespace box2d
|
||||
PolygonShape::PolygonShape(b2PolygonShape * p)
|
||||
{
|
||||
shape = p;
|
||||
Memoizer::add(shape, this);
|
||||
}
|
||||
|
||||
PolygonShape::~PolygonShape()
|
||||
{
|
||||
Memoizer::remove(shape);
|
||||
delete shape;
|
||||
shape = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user