From e9b334d7bf270682f83c5c18b2d85a25703c1a2d Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Tue, 5 May 2020 14:48:35 +0300 Subject: More use of GetModelIndex --- src/entities/Entity.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/entities') diff --git a/src/entities/Entity.h b/src/entities/Entity.h index dbe2c08b..78dae196 100644 --- a/src/entities/Entity.h +++ b/src/entities/Entity.h @@ -149,7 +149,7 @@ public: bool GetIsOnScreenComplex(void); bool IsVisible(void) { return m_rwObject && bIsVisible && GetIsOnScreen(); } bool IsVisibleComplex(void) { return m_rwObject && bIsVisible && GetIsOnScreenComplex(); } - int GetModelIndex(void) { return m_modelIndex; } + int16 GetModelIndex(void) const { return m_modelIndex; } void UpdateRwFrame(void); void SetupBigBuilding(void); -- cgit v1.2.3 From 4cc1bb92e74eaabe9d5ef3d20fb658d577699fa9 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Tue, 5 May 2020 15:06:55 +0300 Subject: Make CBaseModelInfo fields protected --- src/entities/Building.cpp | 2 +- src/entities/Entity.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/entities') diff --git a/src/entities/Building.cpp b/src/entities/Building.cpp index aad2d402..3c096636 100644 --- a/src/entities/Building.cpp +++ b/src/entities/Building.cpp @@ -12,7 +12,7 @@ CBuilding::ReplaceWithNewModel(int32 id) { DeleteRwObject(); - if(CModelInfo::GetModelInfo(m_modelIndex)->m_refCount == 0) + if (CModelInfo::GetModelInfo(m_modelIndex)->GetNumRefs() == 0) CStreaming::RemoveModel(m_modelIndex); m_modelIndex = id; diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp index 2a6211d6..4e4c9dbc 100644 --- a/src/entities/Entity.cpp +++ b/src/entities/Entity.cpp @@ -452,7 +452,7 @@ CEntity::PreRender(void) break; } - if(CModelInfo::GetModelInfo(GetModelIndex())->m_num2dEffects != 0) + if (CModelInfo::GetModelInfo(GetModelIndex())->GetNum2dEffects() != 0) ProcessLightsForEntity(); } @@ -611,7 +611,7 @@ CEntity::AddSteamsFromGround(CVector *unused) C2dEffect *effect; CVector pos; - n = CModelInfo::GetModelInfo(GetModelIndex())->m_num2dEffects; + n = CModelInfo::GetModelInfo(GetModelIndex())->GetNum2dEffects(); for(i = 0; i < n; i++){ effect = CModelInfo::GetModelInfo(GetModelIndex())->Get2dEffect(i); if(effect->type != EFFECT_PARTICLE) @@ -654,7 +654,7 @@ CEntity::ProcessLightsForEntity(void) flashTimer2 = 0; flashTimer3 = 0; - n = CModelInfo::GetModelInfo(GetModelIndex())->m_num2dEffects; + n = CModelInfo::GetModelInfo(GetModelIndex())->GetNum2dEffects(); for(i = 0; i < n; i++, flashTimer1 += 0x80, flashTimer2 += 0x100, flashTimer3 += 0x200){ effect = CModelInfo::GetModelInfo(GetModelIndex())->Get2dEffect(i); -- cgit v1.2.3