diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-05-05 16:14:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-05 16:14:01 +0200 |
commit | fcd386f55d54b84a22540c106ba53f60b7c9b5f5 (patch) | |
tree | 4263c1f88eb693268e4b75104a5b2430b6dff580 /src/core/Collision.cpp | |
parent | fixed traffic lights (diff) | |
parent | Merge branch 'master' of github.com:gtamodding/re3 (diff) | |
download | re3-fcd386f55d54b84a22540c106ba53f60b7c9b5f5.tar re3-fcd386f55d54b84a22540c106ba53f60b7c9b5f5.tar.gz re3-fcd386f55d54b84a22540c106ba53f60b7c9b5f5.tar.bz2 re3-fcd386f55d54b84a22540c106ba53f60b7c9b5f5.tar.lz re3-fcd386f55d54b84a22540c106ba53f60b7c9b5f5.tar.xz re3-fcd386f55d54b84a22540c106ba53f60b7c9b5f5.tar.zst re3-fcd386f55d54b84a22540c106ba53f60b7c9b5f5.zip |
Diffstat (limited to 'src/core/Collision.cpp')
-rw-r--r-- | src/core/Collision.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp index 7dfe3651..f20fee6d 100644 --- a/src/core/Collision.cpp +++ b/src/core/Collision.cpp @@ -20,6 +20,10 @@ #include "SurfaceTable.h" #include "Lines.h" #include "Collision.h" +#ifdef MIAMI +#include "Camera.h" +#include "ColStore.h" +#endif enum Direction { @@ -34,22 +38,32 @@ enum Direction eLevelName CCollision::ms_collisionInMemory; CLinkList<CColModel*> CCollision::ms_colModelCache; +//--MIAMI: done void CCollision::Init(void) { ms_colModelCache.Init(NUMCOLCACHELINKS); ms_collisionInMemory = LEVEL_NONE; +#ifdef MIAMI + CColStore::Initialise(); +#endif } +//--MIAMI: done void CCollision::Shutdown(void) { ms_colModelCache.Shutdown(); +#ifdef MIAMI + CColStore::Shutdown(); +#endif } +//--MIAMI: done void CCollision::Update(void) { +#ifndef MIAMI CVector playerCoors; playerCoors = FindPlayerCoors(); eLevelName level = CTheZones::m_CurrLevel; @@ -83,8 +97,10 @@ CCollision::Update(void) if(ms_collisionInMemory != CGame::currLevel) LoadCollisionWhenINeedIt(forceLevelChange); CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel); +#endif } +//--MIAMI: unused eLevelName GetCollisionInSectorList(CPtrList &list) { @@ -101,6 +117,7 @@ GetCollisionInSectorList(CPtrList &list) return LEVEL_NONE; } +//--MIAMI: unused // Get a level this sector is in based on collision models eLevelName GetCollisionInSector(CSector §) @@ -121,9 +138,11 @@ GetCollisionInSector(CSector §) return (eLevelName)level; } +//--MIAMI: done void CCollision::LoadCollisionWhenINeedIt(bool forceChange) { +#ifndef MIAMI eLevelName level, l; bool multipleLevels; CVector playerCoors; @@ -184,6 +203,7 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange) CPad::StopPadsShaking(); LoadCollisionScreen(CGame::currLevel); DMAudio.Service(); + CPopulation::DealWithZoneChange(ms_collisionInMemory, CGame::currLevel, false); CStreaming::RemoveIslandsNotUsed(LEVEL_INDUSTRIAL); CStreaming::RemoveIslandsNotUsed(LEVEL_COMMERCIAL); @@ -204,15 +224,19 @@ CCollision::LoadCollisionWhenINeedIt(bool forceChange) CStreaming::RequestBigBuildings(CGame::currLevel); CStreaming::LoadAllRequestedModels(true); CStreaming::HaveAllBigBuildingsLoaded(CGame::currLevel); + CGame::TidyUpMemory(true, true); CTimer::Update(); DMAudio.SetEffectsFadeVol(127); } +#endif } +//--MIAMI: done void CCollision::SortOutCollisionAfterLoad(void) { +#ifndef MIAMI if(ms_collisionInMemory == CGame::currLevel) return; @@ -224,6 +248,10 @@ CCollision::SortOutCollisionAfterLoad(void) } ms_collisionInMemory = CGame::currLevel; CGame::TidyUpMemory(true, false); +#else + CColStore::LoadCollision(TheCamera.GetPosition()); + CStreaming::LoadAllRequestedModels(false); +#endif } void @@ -1972,7 +2000,11 @@ CColModel::CColModel(void) vertices = nil; triangles = nil; trianglePlanes = nil; +#ifndef MIAMI level = CGame::currLevel; +#else + level = 0; // generic col slot +#endif ownsCollisionVolumes = true; } |