diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/Renderer.cpp | 34 | ||||
-rw-r--r-- | src/render/Renderer.h | 3 |
2 files changed, 22 insertions, 15 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 58311574..c2982d6d 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -814,36 +814,42 @@ CRenderer::RenderWorld(int pass) } void -CRenderer::RenderVehiclesAndPeds(void) +CRenderer::RenderPeds(void) +{ + int i; + CEntity *e; + + for(i = 0; i < ms_nNoOfVisibleVehicles; i++){ + e = ms_aVisibleVehiclePtrs[i]; + if(e->IsPed()) + RenderOneNonRoad(e); + } +} + +void +CRenderer::RenderVehicles(void) { int i; CEntity *e; EntityInfo ei; CLink<EntityInfo> *node; - RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE); - //CVisibilityPlugins::InitAlphaEntityList(); // not safe yet - // not the real thing for(i = 0; i < ms_nNoOfVisibleVehicles; i++){ e = ms_aVisibleVehiclePtrs[i]; - if(e->IsVehicle() && PutIntoSortedVehicleList((CVehicle*)e)) + if(!e->IsVehicle()) + continue; + if(PutIntoSortedVehicleList((CVehicle*)e)) continue; // boats handled elsewhere - if(e->IsPed()) - RenderOneNonRoad(e); - else{ - ei.ent = e; - ei.sort = (ms_vecCameraPosition - e->GetPosition()).MagnitudeSqr(); - gSortedVehiclesAndPeds.InsertSorted(ei); - } + 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); } void diff --git a/src/render/Renderer.h b/src/render/Renderer.h index ec9d9023..b579bb4c 100644 --- a/src/render/Renderer.h +++ b/src/render/Renderer.h @@ -74,7 +74,8 @@ public: #ifdef NEW_RENDERER static void ClearForFrame(void); - static void RenderVehiclesAndPeds(void); // just called RenderVehicles in LCS + static void RenderPeds(void); + static void RenderVehicles(void); // also renders peds in LCS static void RenderOneBuilding(CEntity *ent, float camdist = 0.0f); static void RenderWorld(int pass); // like cWorldStream::Render(int) static void RenderTransparentWater(void); // keep-out polys and transparent water |