diff options
author | aap <aap@papnet.eu> | 2020-11-04 22:45:01 +0100 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-11-04 22:45:01 +0100 |
commit | 0662de53234d331663d74c85e56d4c21633c2503 (patch) | |
tree | 7c504548afda10e075c30295ddf1314dfa562a26 /src/render/Renderer.cpp | |
parent | fixed boats for new renderer (diff) | |
download | re3-0662de53234d331663d74c85e56d4c21633c2503.tar re3-0662de53234d331663d74c85e56d4c21633c2503.tar.gz re3-0662de53234d331663d74c85e56d4c21633c2503.tar.bz2 re3-0662de53234d331663d74c85e56d4c21633c2503.tar.lz re3-0662de53234d331663d74c85e56d4c21633c2503.tar.xz re3-0662de53234d331663d74c85e56d4c21633c2503.tar.zst re3-0662de53234d331663d74c85e56d4c21633c2503.zip |
Diffstat (limited to 'src/render/Renderer.cpp')
-rw-r--r-- | src/render/Renderer.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 01600c0d..58311574 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -818,6 +818,8 @@ CRenderer::RenderVehiclesAndPeds(void) { int i; CEntity *e; + EntityInfo ei; + CLink<EntityInfo> *node; RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); //CVisibilityPlugins::InitAlphaEntityList(); // not safe yet @@ -826,9 +828,21 @@ CRenderer::RenderVehiclesAndPeds(void) for(i = 0; i < ms_nNoOfVisibleVehicles; i++){ e = ms_aVisibleVehiclePtrs[i]; if(e->IsVehicle() && PutIntoSortedVehicleList((CVehicle*)e)) - continue; - RenderOneNonRoad(e); + continue; // boats handled elsewhere + if(e->IsPed()) + RenderOneNonRoad(e); + else{ + ei.ent = e; + ei.sort = (ms_vecCameraPosition - e->GetPosition()).MagnitudeSqr(); + gSortedVehiclesAndPeds.InsertSorted(ei); + } } + + for(node = gSortedVehiclesAndPeds.tail.prev; + node != &gSortedVehiclesAndPeds.head; + node = node->prev) + RenderOneNonRoad(node->item.ent); + // RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE); } |