diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-09-29 21:53:12 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-09-30 01:41:42 +0200 |
commit | f71953077d2412c4542e616cc9748217dfe046c7 (patch) | |
tree | 3a3adac3c9d143686d198fff3360f8a9945cff67 /src/modelinfo | |
parent | Merge pull request #727 from erorcun/miami (diff) | |
download | re3-f71953077d2412c4542e616cc9748217dfe046c7.tar re3-f71953077d2412c4542e616cc9748217dfe046c7.tar.gz re3-f71953077d2412c4542e616cc9748217dfe046c7.tar.bz2 re3-f71953077d2412c4542e616cc9748217dfe046c7.tar.lz re3-f71953077d2412c4542e616cc9748217dfe046c7.tar.xz re3-f71953077d2412c4542e616cc9748217dfe046c7.tar.zst re3-f71953077d2412c4542e616cc9748217dfe046c7.zip |
Diffstat (limited to 'src/modelinfo')
-rw-r--r-- | src/modelinfo/ModelInfo.cpp | 27 | ||||
-rw-r--r-- | src/modelinfo/ModelInfo.h | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp index 3dc048c9..961efa84 100644 --- a/src/modelinfo/ModelInfo.cpp +++ b/src/modelinfo/ModelInfo.cpp @@ -5,6 +5,8 @@ #include "ModelIndices.h" #include "ModelInfo.h" +// --MIAMI: file done + CBaseModelInfo *CModelInfo::ms_modelInfoPtrs[MODELINFOSIZE]; CStore<CSimpleModelInfo, SIMPLEMODELSIZE> CModelInfo::ms_simpleModelStore; @@ -21,6 +23,14 @@ CModelInfo::Initialise(void) int i; CSimpleModelInfo *m; + debug("sizeof SimpleModelStore %d\n", sizeof(ms_simpleModelStore)); + debug("sizeof TimeModelStore %d\n", sizeof(ms_timeModelStore)); + debug("sizeof WeaponModelStore %d\n", sizeof(ms_weaponModelStore)); + debug("sizeof ClumpModelStore %d\n", sizeof(ms_clumpModelStore)); + debug("sizeof VehicleModelStore %d\n", sizeof(ms_vehicleModelStore)); + debug("sizeof PedModelStore %d\n", sizeof(ms_pedModelStore)); + debug("sizeof 2deffectsModelStore %d\n", sizeof(ms_2dEffectStore)); + for(i = 0; i < MODELINFOSIZE; i++) ms_modelInfoPtrs[i] = nil; ms_2dEffectStore.clear(); @@ -191,6 +201,9 @@ CModelInfo::GetModelInfo(const char *name, int *id) CBaseModelInfo* CModelInfo::GetModelInfo(const char *name, int minIndex, int maxIndex) { + if (minIndex > maxIndex) + return 0; + CBaseModelInfo *modelinfo; for(int i = minIndex; i <= maxIndex; i++){ modelinfo = CModelInfo::ms_modelInfoPtrs[i]; @@ -221,6 +234,20 @@ CModelInfo::IsCarModel(int32 id) ((CVehicleModelInfo*)GetModelInfo(id))->m_vehicleType == VEHICLE_TYPE_CAR; } +bool +CModelInfo::IsHeliModel(int32 id) +{ + return GetModelInfo(id)->GetModelType() == MITYPE_VEHICLE && + ((CVehicleModelInfo*)GetModelInfo(id))->m_vehicleType == VEHICLE_TYPE_HELI; +} + +bool +CModelInfo::IsPlaneModel(int32 id) +{ + return GetModelInfo(id)->GetModelType() == MITYPE_VEHICLE && + ((CVehicleModelInfo*)GetModelInfo(id))->m_vehicleType == VEHICLE_TYPE_PLANE; +} + void CModelInfo::ReInit2dEffects() { diff --git a/src/modelinfo/ModelInfo.h b/src/modelinfo/ModelInfo.h index a24ba797..1ac7b0bb 100644 --- a/src/modelinfo/ModelInfo.h +++ b/src/modelinfo/ModelInfo.h @@ -43,5 +43,7 @@ public: static bool IsBoatModel(int32 id); static bool IsBikeModel(int32 id); static bool IsCarModel(int32 id); + static bool IsHeliModel(int32 id); + static bool IsPlaneModel(int32 id); static void ReInit2dEffects(); }; |