mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-08-31 18:32:07 +02:00
ColModel / Triangle planes: more fixes for miami and liberty
This commit is contained in:
committed by
Stefanos Kornilios Mitsis Poiitidis
parent
3b7f5cffc3
commit
1c12637506
@@ -2,6 +2,7 @@
|
||||
#include "ColModel.h"
|
||||
#include "Game.h"
|
||||
#include "MemoryHeap.h"
|
||||
#include "Collision.h"
|
||||
|
||||
void* re3StreamingAlloc(size_t size);
|
||||
|
||||
@@ -24,12 +25,12 @@ CColModel::CColModel(void)
|
||||
CColModel::~CColModel(void)
|
||||
{
|
||||
RemoveCollisionVolumes();
|
||||
RemoveTrianglePlanes();
|
||||
}
|
||||
|
||||
void
|
||||
CColModel::RemoveCollisionVolumes(void)
|
||||
{
|
||||
CCollision::RemoveTrianglePlanes(this);
|
||||
if(ownsCollisionVolumes){
|
||||
RwFree(spheres);
|
||||
RwFree(lines);
|
||||
@@ -95,6 +96,8 @@ CColModel::operator=(const CColModel &other)
|
||||
int i;
|
||||
int numVerts;
|
||||
|
||||
CCollision::RemoveTrianglePlanes(this);
|
||||
|
||||
boundingSphere = other.boundingSphere;
|
||||
boundingBox = other.boundingBox;
|
||||
|
||||
|
@@ -223,7 +223,7 @@ CFileLoader::LoadCollisionFile(const char *filename)
|
||||
|
||||
mi = CModelInfo::GetModelInfo(modelname, nil);
|
||||
if(mi){
|
||||
if(mi->GetColModel()){
|
||||
if(mi->GetColModel() && mi->DoesOwnColModel()){
|
||||
LoadCollisionModel(work_buff+24, *mi->GetColModel(), modelname);
|
||||
}else{
|
||||
CColModel *model = new CColModel;
|
||||
|
@@ -45,13 +45,13 @@ CColModel::operator delete(void *p, size_t) throw()
|
||||
void
|
||||
CColModel::RemoveCollisionVolumes(void)
|
||||
{
|
||||
CCollision::RemoveTrianglePlanes(this);
|
||||
if(ownsCollisionVolumes){
|
||||
RwFree(spheres);
|
||||
RwFree(lines);
|
||||
RwFree(boxes);
|
||||
RwFree(vertices);
|
||||
RwFree(triangles);
|
||||
CCollision::RemoveTrianglePlanes(this);
|
||||
}
|
||||
numSpheres = 0;
|
||||
numLines = 0;
|
||||
@@ -111,6 +111,8 @@ CColModel::operator=(const CColModel &other)
|
||||
int i;
|
||||
int numVerts;
|
||||
|
||||
CCollision::RemoveTrianglePlanes(this);
|
||||
|
||||
boundingSphere = other.boundingSphere;
|
||||
boundingBox = other.boundingBox;
|
||||
|
||||
|
Reference in New Issue
Block a user