From 60c412149dd0788e31398667e515a17c1a9b449a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Mon, 13 Apr 2020 05:32:11 +0300 Subject: CFileLoader last funcs and Frontend cleanup --- src/modelinfo/ModelInfo.cpp | 17 +++++++++++------ src/modelinfo/ModelInfo.h | 3 ++- 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src/modelinfo') diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp index d956abaa..b6a95992 100644 --- a/src/modelinfo/ModelInfo.cpp +++ b/src/modelinfo/ModelInfo.cpp @@ -234,12 +234,6 @@ CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level) } } -CStore& -CModelInfo::GetMloInstanceStore() -{ - return CModelInfo::ms_mloInstanceStore; -} - void CModelInfo::ConstructMloClumps() { @@ -247,6 +241,17 @@ CModelInfo::ConstructMloClumps() ms_mloModelStore.store[i].ConstructClump(); } +void +CModelInfo::ReInit2dEffects() +{ + ms_2dEffectStore.clear(); + + for (int i = 0; i < MODELINFOSIZE; i++) { + if (ms_modelInfoPtrs[i]) + ms_modelInfoPtrs[i]->Init2dEffects(); + } +} + STARTPATCHES InjectHook(0x50B310, CModelInfo::Initialise, PATCH_JUMP); InjectHook(0x50B5B0, CModelInfo::ShutDown, PATCH_JUMP); diff --git a/src/modelinfo/ModelInfo.h b/src/modelinfo/ModelInfo.h index 13756ddf..e6dec1d8 100644 --- a/src/modelinfo/ModelInfo.h +++ b/src/modelinfo/ModelInfo.h @@ -36,7 +36,7 @@ public: static CVehicleModelInfo *AddVehicleModel(int id); static CStore &Get2dEffectStore(void) { return ms_2dEffectStore; } - static CStore &GetMloInstanceStore(); + static CStore &GetMloInstanceStore(void) { return ms_mloInstanceStore; } static CBaseModelInfo *GetModelInfo(const char *name, int *id); static CBaseModelInfo *GetModelInfo(int id){ @@ -47,4 +47,5 @@ public: static bool IsBikeModel(int32 id); static void RemoveColModelsFromOtherLevels(eLevelName level); static void ConstructMloClumps(); + static void ReInit2dEffects(); }; -- cgit v1.2.3