From 5f1b82252302958922f8deb60e65f5e4e592bd92 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 15 Nov 2016 13:30:30 +0100 Subject: [PATCH] Mark rendered lines in the automap --- src/r_poly.cpp | 11 +++++++++-- src/r_poly.h | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/r_poly.cpp b/src/r_poly.cpp index 42cc84e5fe..c95083c1db 100644 --- a/src/r_poly.cpp +++ b/src/r_poly.cpp @@ -102,7 +102,7 @@ void RenderPolyScene::RenderSubsector(subsector_t *sub) { seg_t *line = &sub->firstline[i]; if (line->sidedef == nullptr || !(line->sidedef->Flags & WALLF_POLYOBJ)) - RenderLine(line, frontsector, subsectorDepth); + RenderLine(sub, line, frontsector, subsectorDepth); } SpriteRange sprites = GetSpritesForSector(sub->sector); @@ -136,7 +136,7 @@ SpriteRange RenderPolyScene::GetSpritesForSector(sector_t *sector) 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 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)) 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 if (RenderPolyWall::RenderLine(WorldToClip, line, frontsector, subsectorDepth, SubsectorTranslucentWalls)) { diff --git a/src/r_poly.h b/src/r_poly.h index b182a582dd..35105e4f96 100644 --- a/src/r_poly.h +++ b/src/r_poly.h @@ -85,7 +85,7 @@ public: private: 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(); SpriteRange GetSpritesForSector(sector_t *sector);