- Remove unused code

This commit is contained in:
Magnus Norddahl 2017-09-02 15:02:06 +02:00
parent 7195af40f8
commit 0f0cf7261e
2 changed files with 3 additions and 43 deletions

View file

@ -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)

View file

@ -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<sector_t *> SeenSectors;
std::unordered_map<subsector_t *, uint32_t> SubsectorDepths;
std::vector<PolyTranslucentObject *> TranslucentObjects;