From 0f0cf7261ef0df07f29d7ee9914f6ae390c50b28 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 2 Sep 2017 15:02:06 +0200 Subject: [PATCH] - Remove unused code --- src/polyrenderer/scene/poly_scene.cpp | 43 ++------------------------- src/polyrenderer/scene/poly_scene.h | 3 +- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/src/polyrenderer/scene/poly_scene.cpp b/src/polyrenderer/scene/poly_scene.cpp index 8e0cf78cd..7cdc4888b 100644 --- a/src/polyrenderer/scene/poly_scene.cpp +++ b/src/polyrenderer/scene/poly_scene.cpp @@ -86,7 +86,6 @@ void RenderPolyScene::ClearBuffers() TranslucentObjects.clear(); SectorPortals.clear(); LinePortals.clear(); - NextSubsectorDepth = 0; } void RenderPolyScene::RenderSectors() @@ -94,55 +93,17 @@ void RenderPolyScene::RenderSectors() int count = (int)Cull.PvsSectors.size(); auto subsectors = Cull.PvsSectors.data(); - int nextCeilingZChange = 0; - int nextFloorZChange = 0; - uint32_t ceilingSubsectorDepth = 0; - uint32_t floorSubsectorDepth = 0; - for (int i = 0; i < count; i++) { - // The software renderer only updates the clipping if the sector height changes. - // Find the subsector depths for when that happens. - if (i == nextCeilingZChange) - { - double z = subsectors[i]->sector->ceilingplane.Zat0(); - nextCeilingZChange++; - while (nextCeilingZChange < count) - { - double nextZ = subsectors[nextCeilingZChange]->sector->ceilingplane.Zat0(); - if (nextZ > z) - break; - z = nextZ; - nextCeilingZChange++; - } - ceilingSubsectorDepth = NextSubsectorDepth + nextCeilingZChange - i - 1; - } - if (i == nextFloorZChange) - { - double z = subsectors[i]->sector->floorplane.Zat0(); - nextFloorZChange++; - while (nextFloorZChange < count) - { - double nextZ = subsectors[nextFloorZChange]->sector->floorplane.Zat0(); - if (nextZ < z) - break; - z = nextZ; - nextFloorZChange++; - } - floorSubsectorDepth = NextSubsectorDepth + nextFloorZChange - i - 1; - } - - RenderSubsector(subsectors[i], ceilingSubsectorDepth, floorSubsectorDepth); + RenderSubsector(subsectors[i], i); } } -void RenderPolyScene::RenderSubsector(subsector_t *sub, uint32_t ceilingSubsectorDepth, uint32_t floorSubsectorDepth) +void RenderPolyScene::RenderSubsector(subsector_t *sub, uint32_t subsectorDepth) { sector_t *frontsector = sub->sector; frontsector->MoreFlags |= SECF_DRAWN; - uint32_t subsectorDepth = NextSubsectorDepth++; - bool mainBSP = sub->polys == nullptr; if (sub->polys) diff --git a/src/polyrenderer/scene/poly_scene.h b/src/polyrenderer/scene/poly_scene.h index 2e0c4821b..5e768fbdb 100644 --- a/src/polyrenderer/scene/poly_scene.h +++ b/src/polyrenderer/scene/poly_scene.h @@ -97,7 +97,7 @@ private: void ClearBuffers(); void RenderPortals(int portalDepth); void RenderSectors(); - void RenderSubsector(subsector_t *sub, uint32_t ceilingSubsectorDepth, uint32_t floorSubsectorDepth); + void RenderSubsector(subsector_t *sub, uint32_t subsectorDepth); void RenderLine(subsector_t *sub, seg_t *line, sector_t *frontsector, uint32_t subsectorDepth); void RenderSprite(AActor *thing, double sortDistance, const DVector2 &left, const DVector2 &right); void RenderSprite(AActor *thing, double sortDistance, DVector2 left, DVector2 right, double t1, double t2, void *node); @@ -110,7 +110,6 @@ private: PolyClipPlane PortalPlane; uint32_t StencilValue = 0; PolyCull Cull; - uint32_t NextSubsectorDepth = 0; std::set SeenSectors; std::unordered_map SubsectorDepths; std::vector TranslucentObjects;