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.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/collision/ColModel.cpp b/src/collision/ColModel.cpp
index fb90e7dd..d2e01f50 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,7 +17,7 @@ CColModel::CColModel(void)
vertices = nil;
triangles = nil;
trianglePlanes = nil;
- level = CGame::currLevel;
+ level = LEVEL_GENERIC; // generic col slot
ownsCollisionVolumes = true;
}
@@ -25,6 +27,20 @@ CColModel::~CColModel(void)
RemoveTrianglePlanes();
}
+void*
+CColModel::operator new(size_t)
+{
+ CColModel* node = CPools::GetColModelPool()->New();
+ assert(node);
+ return node;
+}
+
+void
+CColModel::operator delete(void *p, size_t)
+{
+ CPools::GetColModelPool()->Delete((CColModel*)p);
+}
+
void
CColModel::RemoveCollisionVolumes(void)
{
@@ -34,6 +50,7 @@ CColModel::RemoveCollisionVolumes(void)
RwFree(boxes);
RwFree(vertices);
RwFree(triangles);
+ CCollision::RemoveTrianglePlanes(this);
}
numSpheres = 0;
numLines = 0;