From 7ca6e7e5c1d2a6181970548cea1ce7b5ff5a15d3 Mon Sep 17 00:00:00 2001 From: Kevin Caccamo Date: Fri, 10 Jan 2020 18:08:01 -0500 Subject: [PATCH] Add handling for drawfullheight flag Parse drawfullheight flag in UDMF Draw full height for walls if the linedef has this flag --- specs/udmf_zdoom.txt | 1 + src/maploader/udmf.cpp | 4 ++++ src/rendering/hwrenderer/scene/hw_walls.cpp | 20 +++++++++++++------- src/utility/namedef.h | 1 + 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index af91fba0ad..7b5b2d3574 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -141,6 +141,7 @@ Note: All fields default to false unless mentioned otherwise. // 13: Portal line. revealed = ; // true = line is initially visible on automap. noskywalls = ; // true = skies are not drawn above or below this line + drawfullheight = ; // true = draw the maximum height instead of the minimum height health = ; // Amount of hitpoints for this line. healthgroup = ; // ID of destructible object to synchronize hitpoints (optional, default is 0) diff --git a/src/maploader/udmf.cpp b/src/maploader/udmf.cpp index 054f8142b0..bdc28d7ab8 100644 --- a/src/maploader/udmf.cpp +++ b/src/maploader/udmf.cpp @@ -1078,6 +1078,10 @@ public: Flag(ld->flags, ML_NOSKYWALLS, key); continue; + case NAME_DrawFullHeight: + Flag(ld->flags, ML_DRAWFULLHEIGHT, key); + continue; + case NAME_MoreIds: // delay parsing of the tag string until parsing of the sector is complete // This ensures that the ID is always the first tag in the list. diff --git a/src/rendering/hwrenderer/scene/hw_walls.cpp b/src/rendering/hwrenderer/scene/hw_walls.cpp index 1873ce5d36..f44c727e68 100644 --- a/src/rendering/hwrenderer/scene/hw_walls.cpp +++ b/src/rendering/hwrenderer/scene/hw_walls.cpp @@ -2023,11 +2023,14 @@ void HWWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_ float bch1a = bch1, bch2a = bch2; if (frontsector->GetTexture(sector_t::floor) != skyflatnum || backsector->GetTexture(sector_t::floor) != skyflatnum) { - // the back sector's floor obstructs part of this wall - if (ffh1 > bch1 && ffh2 > bch2) + // the back sector's floor obstructs part of this wall + if (!seg->linedef->flags & ML_DRAWFULLHEIGHT) { - bch2a = ffh2; - bch1a = ffh1; + if (ffh1 > bch1 && ffh2 > bch2) + { + bch2a = ffh2; + bch1a = ffh1; + } } } @@ -2105,10 +2108,13 @@ void HWWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_ /* bottom texture */ // the back sector's ceiling obstructs part of this wall (specially important for sky sectors) - if (fch1 < bfh1 && fch2 < bfh2) + if (!seg->linedef->flags & ML_DRAWFULLHEIGHT) { - bfh1 = fch1; - bfh2 = fch2; + if (fch1 < bfh1 && fch2 < bfh2) + { + bfh1 = fch1; + bfh2 = fch2; + } } if (bfh1 > ffh1 || bfh2 > ffh2) diff --git a/src/utility/namedef.h b/src/utility/namedef.h index 8cee067cd3..9aa0e4cc52 100644 --- a/src/utility/namedef.h +++ b/src/utility/namedef.h @@ -551,6 +551,7 @@ xx(Locknumber) xx(Midtex3dimpassible) xx(Revealed) xx(AutomapStyle) +xx(DrawFullHeight) xx(Playercross) xx(Playeruse)