summaryrefslogtreecommitdiffstats
path: root/src/collision/ColModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/collision/ColModel.cpp')
-rw-r--r--src/collision/ColModel.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/collision/ColModel.cpp b/src/collision/ColModel.cpp
index fb90e7dd..2224a804 100644
--- a/src/collision/ColModel.cpp
+++ b/src/collision/ColModel.cpp
@@ -1,7 +1,9 @@
#include "common.h"
#include "ColModel.h"
+#include "Collision.h"
#include "Game.h"
#include "MemoryHeap.h"
+#include "Pools.h"
CColModel::CColModel(void)
{
@@ -15,14 +17,27 @@ CColModel::CColModel(void)
vertices = nil;
triangles = nil;
trianglePlanes = nil;
- level = CGame::currLevel;
+ level = LEVEL_GENERIC; // generic col slot
ownsCollisionVolumes = true;
}
CColModel::~CColModel(void)
{
RemoveCollisionVolumes();
- RemoveTrianglePlanes();
+}
+
+void*
+CColModel::operator new(size_t) throw()
+{
+ CColModel* node = CPools::GetColModelPool()->New();
+ assert(node);
+ return node;
+}
+
+void
+CColModel::operator delete(void *p, size_t) throw()
+{
+ CPools::GetColModelPool()->Delete((CColModel*)p);
}
void
@@ -34,6 +49,7 @@ CColModel::RemoveCollisionVolumes(void)
RwFree(boxes);
RwFree(vertices);
RwFree(triangles);
+ CCollision::RemoveTrianglePlanes(this);
}
numSpheres = 0;
numLines = 0;