summaryrefslogtreecommitdiffstats
path: root/src/modelinfo/ModelInfo.cpp
diff options
context:
space:
mode:
authorRoman Masanin <36927roma@gmail.com>2020-10-03 00:52:37 +0200
committerRoman Masanin <36927roma@gmail.com>2020-10-03 00:52:37 +0200
commit55d94c99b8ef758b7a1016734dbfc6acba5c7e7d (patch)
treeb838285cbdeae5e390a0bdf3dbd552ce3c1c7130 /src/modelinfo/ModelInfo.cpp
parentfix ternary operator (diff)
parentMerge pull request #737 from theR4K/miamiDev (diff)
downloadre3-55d94c99b8ef758b7a1016734dbfc6acba5c7e7d.tar
re3-55d94c99b8ef758b7a1016734dbfc6acba5c7e7d.tar.gz
re3-55d94c99b8ef758b7a1016734dbfc6acba5c7e7d.tar.bz2
re3-55d94c99b8ef758b7a1016734dbfc6acba5c7e7d.tar.lz
re3-55d94c99b8ef758b7a1016734dbfc6acba5c7e7d.tar.xz
re3-55d94c99b8ef758b7a1016734dbfc6acba5c7e7d.tar.zst
re3-55d94c99b8ef758b7a1016734dbfc6acba5c7e7d.zip
Diffstat (limited to 'src/modelinfo/ModelInfo.cpp')
-rw-r--r--src/modelinfo/ModelInfo.cpp27
1 files changed, 27 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()
{