summaryrefslogtreecommitdiffstats
path: root/src/render/Renderer.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-07-04 04:00:33 +0200
committereray orçunus <erayorcunus@gmail.com>2019-07-04 04:00:33 +0200
commitcc56292bc503d5aaa96c5146480ab8bd1b6b0488 (patch)
tree77949cc32155e844b34c75f856f79ff3f3ad9cec /src/render/Renderer.cpp
parentEven more CPed (diff)
parentMerge pull request #107 from Nick007J/master (diff)
downloadre3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.gz
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.bz2
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.lz
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.xz
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.tar.zst
re3-cc56292bc503d5aaa96c5146480ab8bd1b6b0488.zip
Diffstat (limited to '')
-rw-r--r--src/render/Renderer.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index d8b0bbe6..405b9bb2 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -222,16 +222,16 @@ CRenderer::RenderEverythingBarRoads(void)
if(e->IsVehicle() ||
e->IsPed() && CVisibilityPlugins::GetClumpAlpha((RpClump*)e->m_rwObject) != 255){
if(e->IsVehicle() && ((CVehicle*)e)->IsBoat()){
+ ei.ent = e;
+ dist = ms_vecCameraPosition - e->GetPosition();
+ ei.sort = dist.MagnitudeSqr();
+ gSortedVehiclesAndPeds.InsertSorted(ei);
+ }else{
dist = ms_vecCameraPosition - e->GetPosition();
if(!CVisibilityPlugins::InsertEntityIntoSortedList(e, dist.Magnitude())){
printf("Ran out of space in alpha entity list");
RenderOneNonRoad(e);
}
- }else{
- ei.ent = e;
- dist = ms_vecCameraPosition - e->GetPosition();
- ei.sort = dist.MagnitudeSqr();
- gSortedVehiclesAndPeds.InsertSorted(ei);
}
}else
RenderOneNonRoad(e);
@@ -241,15 +241,17 @@ CRenderer::RenderEverythingBarRoads(void)
void
CRenderer::RenderVehiclesButNotBoats(void)
{
+ // This function doesn't do anything
+ // because only boats are inserted into the list
CLink<EntityInfo> *node;
for(node = gSortedVehiclesAndPeds.tail.prev;
node != &gSortedVehiclesAndPeds.head;
node = node->prev){
+ // only boats in this list
CVehicle *v = (CVehicle*)node->item.ent;
- if(v->IsVehicle() && v->IsBoat()) // BUG: IsVehicle missing in III
- continue;
- RenderOneNonRoad(v);
+ if(!v->IsBoat())
+ RenderOneNonRoad(v);
}
}
@@ -261,8 +263,9 @@ CRenderer::RenderBoats(void)
for(node = gSortedVehiclesAndPeds.tail.prev;
node != &gSortedVehiclesAndPeds.head;
node = node->prev){
+ // only boats in this list
CVehicle *v = (CVehicle*)node->item.ent;
- if(v->IsVehicle() && v->IsBoat()) // BUG: IsVehicle missing in III
+ if(v->IsBoat())
RenderOneNonRoad(v);
}
}