diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-05 19:22:17 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-05 19:22:17 +0200 |
commit | f45ea0a1cf5ab2c46e53d3e352cb3a5b0ded1b80 (patch) | |
tree | dc15134e54afea71e397a16ab828a0a73edc0ea9 /src/modelinfo | |
parent | some more miami (diff) | |
parent | some miami limits (diff) | |
download | re3-f45ea0a1cf5ab2c46e53d3e352cb3a5b0ded1b80.tar re3-f45ea0a1cf5ab2c46e53d3e352cb3a5b0ded1b80.tar.gz re3-f45ea0a1cf5ab2c46e53d3e352cb3a5b0ded1b80.tar.bz2 re3-f45ea0a1cf5ab2c46e53d3e352cb3a5b0ded1b80.tar.lz re3-f45ea0a1cf5ab2c46e53d3e352cb3a5b0ded1b80.tar.xz re3-f45ea0a1cf5ab2c46e53d3e352cb3a5b0ded1b80.tar.zst re3-f45ea0a1cf5ab2c46e53d3e352cb3a5b0ded1b80.zip |
Diffstat (limited to 'src/modelinfo')
-rw-r--r-- | src/modelinfo/MloModelInfo.cpp | 39 | ||||
-rw-r--r-- | src/modelinfo/MloModelInfo.h | 14 | ||||
-rw-r--r-- | src/modelinfo/ModelInfo.cpp | 55 | ||||
-rw-r--r-- | src/modelinfo/ModelInfo.h | 11 | ||||
-rw-r--r-- | src/modelinfo/SimpleModelInfo.cpp | 2 | ||||
-rw-r--r-- | src/modelinfo/SimpleModelInfo.h | 4 | ||||
-rw-r--r-- | src/modelinfo/XtraCompsModelInfo.h | 12 |
7 files changed, 1 insertions, 136 deletions
diff --git a/src/modelinfo/MloModelInfo.cpp b/src/modelinfo/MloModelInfo.cpp deleted file mode 100644 index 7535e6c5..00000000 --- a/src/modelinfo/MloModelInfo.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "common.h" - -#include "VisibilityPlugins.h" -#include "ModelInfo.h" - -void -CMloModelInfo::ConstructClump() -{ - m_clump = RpClumpCreate(); - RwFrame *mainFrame = RwFrameCreate(); - RwFrameSetIdentity(mainFrame); - RpClumpSetFrame(m_clump, mainFrame); - - for (int i = firstInstance; i < lastInstance; i++) { - int modelId = CModelInfo::GetMloInstanceStore().store[i].m_modelIndex; - RwMatrix *attMat = CModelInfo::GetMloInstanceStore().store[i].GetMatrix().m_attachment; - CSimpleModelInfo *minfo = (CSimpleModelInfo*)CModelInfo::GetModelInfo(modelId); - - if (minfo->m_atomics[0] != nil) { - RpAtomic *newAtomic = RpAtomicClone(minfo->m_atomics[0]); - RwFrame *newFrame = RwFrameCreate(); - if (newAtomic != nil && newFrame != nil) { - *RwFrameGetMatrix(newFrame) = *attMat; - RpAtomicSetFrame(newAtomic, newFrame); - RwFrameAddChild(mainFrame, newFrame); - RpClumpAddAtomic(m_clump, newAtomic); - } else { - debug("Failed to allocate memory while creating template MLO.\n"); - } - } - } - - if (RpClumpGetNumAtomics(m_clump) != 0) { - CVisibilityPlugins::SetClumpModelInfo(m_clump, this); - } else { - RpClumpDestroy(m_clump); - m_clump = nil; - } -}
\ No newline at end of file diff --git a/src/modelinfo/MloModelInfo.h b/src/modelinfo/MloModelInfo.h deleted file mode 100644 index d4344706..00000000 --- a/src/modelinfo/MloModelInfo.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "ClumpModelInfo.h" - -class CMloModelInfo : public CClumpModelInfo -{ -public: - float field_34; // draw distance? - int firstInstance; - int lastInstance; -public: - CMloModelInfo(void) : CClumpModelInfo(MITYPE_MLO) {} - void ConstructClump(); -};
\ No newline at end of file diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp index 62deae2b..79353b1b 100644 --- a/src/modelinfo/ModelInfo.cpp +++ b/src/modelinfo/ModelInfo.cpp @@ -8,13 +8,10 @@ CBaseModelInfo *CModelInfo::ms_modelInfoPtrs[MODELINFOSIZE]; CStore<CSimpleModelInfo, SIMPLEMODELSIZE> CModelInfo::ms_simpleModelStore; -CStore<CMloModelInfo, MLOMODELSIZE> CModelInfo::ms_mloModelStore; -CStore<CInstance, MLOINSTANCESIZE> CModelInfo::ms_mloInstanceStore; CStore<CTimeModelInfo, TIMEMODELSIZE> CModelInfo::ms_timeModelStore; CStore<CClumpModelInfo, CLUMPMODELSIZE> CModelInfo::ms_clumpModelStore; CStore<CPedModelInfo, PEDMODELSIZE> CModelInfo::ms_pedModelStore; CStore<CVehicleModelInfo, VEHICLEMODELSIZE> CModelInfo::ms_vehicleModelStore; -CStore<CXtraCompsModelInfo, XTRACOMPSMODELSIZE> CModelInfo::ms_xtraCompsModelStore; CStore<C2dEffect, TWODFXSIZE> CModelInfo::ms_2dEffectStore; void @@ -26,11 +23,8 @@ CModelInfo::Initialise(void) for(i = 0; i < MODELINFOSIZE; i++) ms_modelInfoPtrs[i] = nil; ms_2dEffectStore.clear(); - ms_mloInstanceStore.clear(); - ms_xtraCompsModelStore.clear(); ms_simpleModelStore.clear(); ms_timeModelStore.clear(); - ms_mloModelStore.clear(); ms_clumpModelStore.clear(); ms_pedModelStore.clear(); ms_vehicleModelStore.clear(); @@ -90,8 +84,6 @@ CModelInfo::ShutDown(void) int i; for(i = 0; i < ms_simpleModelStore.allocPtr; i++) ms_simpleModelStore.store[i].Shutdown(); - for(i = 0; i < ms_mloInstanceStore.allocPtr; i++) - ms_mloInstanceStore.store[i].Shutdown(); for(i = 0; i < ms_timeModelStore.allocPtr; i++) ms_timeModelStore.store[i].Shutdown(); for(i = 0; i < ms_clumpModelStore.allocPtr; i++) @@ -100,18 +92,11 @@ CModelInfo::ShutDown(void) ms_vehicleModelStore.store[i].Shutdown(); for(i = 0; i < ms_pedModelStore.allocPtr; i++) ms_pedModelStore.store[i].Shutdown(); - for(i = 0; i < ms_xtraCompsModelStore.allocPtr; i++) - ms_xtraCompsModelStore.store[i].Shutdown(); - for(i = 0; i < ms_mloInstanceStore.allocPtr; i++) - ms_mloInstanceStore.store[i].Shutdown(); for(i = 0; i < ms_2dEffectStore.allocPtr; i++) ms_2dEffectStore.store[i].Shutdown(); ms_2dEffectStore.clear(); ms_simpleModelStore.clear(); - ms_mloInstanceStore.clear(); - ms_mloModelStore.clear(); - ms_xtraCompsModelStore.clear(); ms_timeModelStore.clear(); ms_pedModelStore.clear(); ms_clumpModelStore.clear(); @@ -128,18 +113,6 @@ CModelInfo::AddSimpleModel(int id) return modelinfo; } -CMloModelInfo * -CModelInfo::AddMloModel(int id) -{ - CMloModelInfo *modelinfo; - modelinfo = CModelInfo::ms_mloModelStore.alloc(); - CModelInfo::ms_modelInfoPtrs[id] = modelinfo; - modelinfo->m_clump = nil; - modelinfo->firstInstance = 0; - modelinfo->lastInstance = 0; - return modelinfo; -} - CTimeModelInfo* CModelInfo::AddTimeModel(int id) { @@ -200,7 +173,6 @@ CModelInfo::GetModelInfo(const char *name, int *id) return nil; } -#ifdef MIAMI CBaseModelInfo* CModelInfo::GetModelInfo(const char *name, int minIndex, int maxIndex) { @@ -212,7 +184,6 @@ CModelInfo::GetModelInfo(const char *name, int minIndex, int maxIndex) } return nil; } -#endif bool CModelInfo::IsBoatModel(int32 id) @@ -228,32 +199,6 @@ CModelInfo::IsBikeModel(int32 id) ((CVehicleModelInfo*)GetModelInfo(id))->m_vehicleType == VEHICLE_TYPE_BIKE; } -#ifndef MIAMI -void -CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level) -{ - int i; - CBaseModelInfo *mi; - CColModel *colmodel; - - for(i = 0; i < MODELINFOSIZE; i++){ - mi = GetModelInfo(i); - if(mi){ - colmodel = mi->GetColModel(); - if(colmodel && colmodel->level != LEVEL_NONE && colmodel->level != level) - colmodel->RemoveCollisionVolumes(); - } - } -} -#endif - -void -CModelInfo::ConstructMloClumps() -{ - for (int i = 0; i < ms_mloModelStore.allocPtr; i++) - ms_mloModelStore.store[i].ConstructClump(); -} - void CModelInfo::ReInit2dEffects() { diff --git a/src/modelinfo/ModelInfo.h b/src/modelinfo/ModelInfo.h index dadc8f8b..46f8c117 100644 --- a/src/modelinfo/ModelInfo.h +++ b/src/modelinfo/ModelInfo.h @@ -3,52 +3,41 @@ #include "2dEffect.h" #include "BaseModelInfo.h" #include "SimpleModelInfo.h" -#include "MloModelInfo.h" #include "TimeModelInfo.h" #include "ClumpModelInfo.h" #include "PedModelInfo.h" #include "VehicleModelInfo.h" -#include "XtraCompsModelInfo.h" #include "Instance.h" class CModelInfo { static CBaseModelInfo *ms_modelInfoPtrs[MODELINFOSIZE]; static CStore<CSimpleModelInfo, SIMPLEMODELSIZE> ms_simpleModelStore; - static CStore<CMloModelInfo, MLOMODELSIZE> ms_mloModelStore; - static CStore<CInstance, MLOINSTANCESIZE> ms_mloInstanceStore; static CStore<CTimeModelInfo, TIMEMODELSIZE> ms_timeModelStore; static CStore<CClumpModelInfo, CLUMPMODELSIZE> ms_clumpModelStore; static CStore<CPedModelInfo, PEDMODELSIZE> ms_pedModelStore; static CStore<CVehicleModelInfo, VEHICLEMODELSIZE> ms_vehicleModelStore; static CStore<C2dEffect, TWODFXSIZE> ms_2dEffectStore; - static CStore<CXtraCompsModelInfo, XTRACOMPSMODELSIZE> ms_xtraCompsModelStore; public: static void Initialise(void); static void ShutDown(void); static CSimpleModelInfo *AddSimpleModel(int id); - static CMloModelInfo *AddMloModel(int id); static CTimeModelInfo *AddTimeModel(int id); static CClumpModelInfo *AddClumpModel(int id); static CPedModelInfo *AddPedModel(int id); static CVehicleModelInfo *AddVehicleModel(int id); static CStore<C2dEffect, TWODFXSIZE> &Get2dEffectStore(void) { return ms_2dEffectStore; } - static CStore<CInstance, MLOINSTANCESIZE> &GetMloInstanceStore(void) { return ms_mloInstanceStore; } static CBaseModelInfo *GetModelInfo(const char *name, int *id); static CBaseModelInfo *GetModelInfo(int id){ return ms_modelInfoPtrs[id]; } -#ifdef MIAMI static CBaseModelInfo *GetModelInfo(const char *name, int minIndex, int maxIndex); -#endif static bool IsBoatModel(int32 id); static bool IsBikeModel(int32 id); - static void RemoveColModelsFromOtherLevels(eLevelName level); - static void ConstructMloClumps(); static void ReInit2dEffects(); }; diff --git a/src/modelinfo/SimpleModelInfo.cpp b/src/modelinfo/SimpleModelInfo.cpp index 63b057da..424fb0e5 100644 --- a/src/modelinfo/SimpleModelInfo.cpp +++ b/src/modelinfo/SimpleModelInfo.cpp @@ -130,7 +130,6 @@ CSimpleModelInfo::GetAtomicFromDistance(float dist) return nil; } -#ifdef MIAMI RpAtomic* CSimpleModelInfo::GetFirstAtomicFromDistance(float dist) { @@ -138,7 +137,6 @@ CSimpleModelInfo::GetFirstAtomicFromDistance(float dist) return m_atomics[0]; return nil; } -#endif void CSimpleModelInfo::FindRelatedModel(void) diff --git a/src/modelinfo/SimpleModelInfo.h b/src/modelinfo/SimpleModelInfo.h index 451a9c00..403e2969 100644 --- a/src/modelinfo/SimpleModelInfo.h +++ b/src/modelinfo/SimpleModelInfo.h @@ -40,9 +40,7 @@ public: float GetNearDistance(void); float GetLargestLodDistance(void); RpAtomic *GetAtomicFromDistance(float dist); -#ifdef MIAMI - RpAtomic *GetFirstAtomicFromDistance(float dist); // inline -#endif + RpAtomic *GetFirstAtomicFromDistance(float dist); void FindRelatedModel(void); void SetupBigBuilding(void); diff --git a/src/modelinfo/XtraCompsModelInfo.h b/src/modelinfo/XtraCompsModelInfo.h deleted file mode 100644 index 9832399c..00000000 --- a/src/modelinfo/XtraCompsModelInfo.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include "ClumpModelInfo.h" - -class CXtraCompsModelInfo : public CClumpModelInfo -{ - int field_34; -public: - CXtraCompsModelInfo(void) : CClumpModelInfo(MITYPE_XTRACOMPS) { field_34 = 0; } - void SetClump(RpClump*) {}; - void Shutdown(void) {}; -};
\ No newline at end of file |