re3-wiiu/src/buildings/Building.cpp

23 lines
632 B
C++
Raw Normal View History

2019-05-15 16:52:37 +02:00
#include "common.h"
2020-04-17 16:31:11 +03:00
2019-05-15 16:52:37 +02:00
#include "Building.h"
2019-06-19 23:41:43 +02:00
#include "Streaming.h"
2019-05-15 16:52:37 +02:00
#include "Pools.h"
2021-06-26 00:27:12 +03:00
void *CBuilding::operator new(size_t sz) throw() { return CPools::GetBuildingPool()->New(); }
void CBuilding::operator delete(void *p, size_t sz) throw() { CPools::GetBuildingPool()->Delete((CBuilding*)p); }
2019-06-19 23:41:43 +02:00
void
CBuilding::ReplaceWithNewModel(int32 id)
{
DeleteRwObject();
2020-05-05 15:06:55 +03:00
if (CModelInfo::GetModelInfo(m_modelIndex)->GetNumRefs() == 0)
2019-06-19 23:41:43 +02:00
CStreaming::RemoveModel(m_modelIndex);
m_modelIndex = id;
if(bIsBIGBuilding)
2020-07-13 17:43:09 +03:00
if(m_level == LEVEL_GENERIC || m_level == CGame::currLevel)
2019-06-20 14:49:16 +02:00
CStreaming::RequestModel(id, STREAMFLAGS_DONT_REMOVE);
2019-06-19 23:41:43 +02:00
}