Mark rendered lines in the automap

This commit is contained in:
Magnus Norddahl 2016-11-15 13:30:30 +01:00
parent f143b9b7b0
commit 5f1b822523
2 changed files with 10 additions and 3 deletions

View file

@ -102,7 +102,7 @@ void RenderPolyScene::RenderSubsector(subsector_t *sub)
{ {
seg_t *line = &sub->firstline[i]; seg_t *line = &sub->firstline[i];
if (line->sidedef == nullptr || !(line->sidedef->Flags & WALLF_POLYOBJ)) if (line->sidedef == nullptr || !(line->sidedef->Flags & WALLF_POLYOBJ))
RenderLine(line, frontsector, subsectorDepth); RenderLine(sub, line, frontsector, subsectorDepth);
} }
SpriteRange sprites = GetSpritesForSector(sub->sector); SpriteRange sprites = GetSpritesForSector(sub->sector);
@ -136,7 +136,7 @@ SpriteRange RenderPolyScene::GetSpritesForSector(sector_t *sector)
return range; return range;
} }
void RenderPolyScene::RenderLine(seg_t *line, sector_t *frontsector, uint32_t subsectorDepth) void RenderPolyScene::RenderLine(subsector_t *sub, seg_t *line, sector_t *frontsector, uint32_t subsectorDepth)
{ {
// Reject lines not facing viewer // Reject lines not facing viewer
DVector2 pt1 = line->v1->fPos() - ViewPos; DVector2 pt1 = line->v1->fPos() - ViewPos;
@ -150,6 +150,13 @@ void RenderPolyScene::RenderLine(seg_t *line, sector_t *frontsector, uint32_t su
if (hasSegmentRange && Cull.IsSegmentCulled(sx1, sx2)) if (hasSegmentRange && Cull.IsSegmentCulled(sx1, sx2))
return; return;
// Tell automap we saw this
if (!r_dontmaplines && line->linedef)
{
line->linedef->flags |= ML_MAPPED;
sub->flags |= SSECF_DRAWN;
}
// Render wall, and update culling info if its an occlusion blocker // Render wall, and update culling info if its an occlusion blocker
if (RenderPolyWall::RenderLine(WorldToClip, line, frontsector, subsectorDepth, SubsectorTranslucentWalls)) if (RenderPolyWall::RenderLine(WorldToClip, line, frontsector, subsectorDepth, SubsectorTranslucentWalls))
{ {

View file

@ -85,7 +85,7 @@ public:
private: private:
void RenderSubsector(subsector_t *sub); void RenderSubsector(subsector_t *sub);
void RenderLine(seg_t *line, sector_t *frontsector, uint32_t subsectorDepth); void RenderLine(subsector_t *sub, seg_t *line, sector_t *frontsector, uint32_t subsectorDepth);
void RenderTranslucent(); void RenderTranslucent();
SpriteRange GetSpritesForSector(sector_t *sector); SpriteRange GetSpritesForSector(sector_t *sector);