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