summaryrefslogtreecommitdiffstats
path: root/src/buildings/Building.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildings/Building.cpp')
-rw-r--r--src/buildings/Building.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/buildings/Building.cpp b/src/buildings/Building.cpp
new file mode 100644
index 00000000..00bbb21e
--- /dev/null
+++ b/src/buildings/Building.cpp
@@ -0,0 +1,22 @@
+#include "common.h"
+
+#include "Building.h"
+#include "Streaming.h"
+#include "Pools.h"
+
+void *CBuilding::operator new(size_t sz) { return CPools::GetBuildingPool()->New(); }
+void CBuilding::operator delete(void *p, size_t sz) { CPools::GetBuildingPool()->Delete((CBuilding*)p); }
+
+void
+CBuilding::ReplaceWithNewModel(int32 id)
+{
+ DeleteRwObject();
+
+ if (CModelInfo::GetModelInfo(m_modelIndex)->GetNumRefs() == 0)
+ CStreaming::RemoveModel(m_modelIndex);
+ m_modelIndex = id;
+
+ if(bIsBIGBuilding)
+ if(m_level == LEVEL_GENERIC || m_level == CGame::currLevel)
+ CStreaming::RequestModel(id, STREAMFLAGS_DONT_REMOVE);
+}