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/render/Renderer.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/render') diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index cb2cb5b7..4325b78a 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -91,9 +91,7 @@ CRenderer::RenderOneRoad(CEntity *e) if(gbDontRenderBuildings) return; if(gbShowCollisionPolys) - CCollision::DrawColModel_Coloured(e->GetMatrix(), - *CModelInfo::GetModelInfo(e->m_modelIndex)->GetColModel(), - e->m_modelIndex); + CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex()); else e->Render(); } @@ -109,9 +107,7 @@ CRenderer::RenderOneNonRoad(CEntity *e) #ifndef MASTER if(gbShowCollisionPolys){ if(!e->IsVehicle()){ - CCollision::DrawColModel_Coloured(e->GetMatrix(), - *CModelInfo::GetModelInfo(e->m_modelIndex)->GetColModel(), - e->m_modelIndex); + CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex()); return; } }else if(e->IsBuilding()){ @@ -332,7 +328,7 @@ enum Visbility int32 CRenderer::SetupEntityVisibility(CEntity *ent) { - CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(ent->m_modelIndex); + CSimpleModelInfo *mi = (CSimpleModelInfo *)CModelInfo::GetModelInfo(ent->GetModelIndex()); CTimeModelInfo *ti; int32 other; float dist; @@ -482,7 +478,7 @@ CRenderer::SetupEntityVisibility(CEntity *ent) int32 CRenderer::SetupBigBuildingVisibility(CEntity *ent) { - CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(ent->m_modelIndex); + CSimpleModelInfo *mi = (CSimpleModelInfo *)CModelInfo::GetModelInfo(ent->GetModelIndex()); CTimeModelInfo *ti; int32 other; @@ -1147,7 +1143,7 @@ CRenderer::SortBIGBuildingsForSectorList(CPtrList *list) bool CRenderer::ShouldModelBeStreamed(CEntity *ent) { - CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(ent->m_modelIndex); + CSimpleModelInfo *mi = (CSimpleModelInfo *)CModelInfo::GetModelInfo(ent->GetModelIndex()); float dist = (ent->GetPosition() - ms_vecCameraPosition).Magnitude(); if(mi->m_noFade) return dist - STREAM_DISTANCE < mi->GetLargestLodDistance(); -- cgit v1.2.3