Skip to content

Commit

Permalink
- reinstated rendering of mid textures over two-sided wall portals.
Browse files Browse the repository at this point in the history
This was removed in the last PR due to z-fighting problems which now have also been addressed
  • Loading branch information
coelckers committed Mar 5, 2021
1 parent a15216c commit 0c0ef4f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/rendering/hwrenderer/scene/hw_drawlistadd.cpp
Expand Up @@ -49,7 +49,7 @@ void HWDrawInfo::AddWall(HWWall *wall)
bool masked = HWWall::passflag[wall->type] == 1 ? false : (wall->texture && wall->texture->isMasked());
int list;

if ((wall->flags & HWWall::HWF_SKYHACK && wall->type == RENDERWALL_M2S))
if (wall->flags & HWWall::HWF_SKYHACK && wall->type == RENDERWALL_M2S)
{
list = GLDL_MASKEDWALLSOFS;
}
Expand Down
11 changes: 11 additions & 0 deletions src/rendering/hwrenderer/scene/hw_walls.cpp
Expand Up @@ -1443,6 +1443,11 @@ void HWWall::DoMidTexture(HWDrawInfo *di, seg_t * seg, bool drawfogboundary,
tci.mScale.Y = -tci.mScale.Y;
flags |= HWF_NOSLICE;
}
if (seg->linedef->isVisualPortal())
{
// mid textures on portal lines need the same offsetting as mid textures on sky lines
flags |= HWF_SKYHACK;
}
SetWallCoordinates(seg, &tci, texturetop, topleft, topright, bottomleft, bottomright, t_ofs);

//
Expand Down Expand Up @@ -2165,6 +2170,12 @@ void HWWall::Process(HWDrawInfo *di, seg_t *seg, sector_t * frontsector, sector_
zbottom[0] = bfh1;
zbottom[1] = bfh2;
PutPortal(di, PORTALTYPE_LINETOLINE, -1);

if (texture && seg->backsector != nullptr)
{
DoMidTexture(di, seg, drawfogboundary, frontsector, backsector, realfront, realback,
fch1, fch2, ffh1, ffh2, bch1, bch2, bfh1, bfh2);
}
}
else
{
Expand Down

0 comments on commit 0c0ef4f

Please sign in to comment.