- better handling for portal lines having sloped back sectors.

This is a very ugly special case that probably needs a bit more work to get right, for now this should be enough as this combination is rather rare.
This commit is contained in:
Christoph Oelckers 2021-04-09 22:48:16 +02:00
parent 19a4c12e6a
commit 345275db5d

View file

@ -893,7 +893,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
#ifdef _DEBUG #ifdef _DEBUG
if (wal - wall == 843) if (wal - wall == 788)
{ {
int a = 0; int a = 0;
} }
@ -990,12 +990,15 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
{ {
float bch1a = bch1; float bch1a = bch1;
float bch2a = bch2; float bch2a = bch2;
if (ffh1 > bch1 && ffh2 > bch2) if (ffh1 > bch1 || ffh2 > bch2)
{
// the back sector's floor obstructs part of this wall. Todo: Handle the portal case better.
if ((ffh1 > bch1 && ffh2 > bch2) || frontsector->portalflags == PORTAL_SECTOR_FLOOR)
{ {
// the back sector's floor obstructs part of this wall
bch2a = ffh2; bch2a = ffh2;
bch1a = ffh1; bch1a = ffh1;
} }
}
if (bch1a < fch1 || bch2a < fch2) if (bch1a < fch1 || bch2a < fch2)
{ {
@ -1025,12 +1028,15 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
// lower texture // lower texture
if (!(frontsector->floorstat & backsector->floorstat & CSTAT_SECTOR_SKY)) if (!(frontsector->floorstat & backsector->floorstat & CSTAT_SECTOR_SKY))
{ {
if (fch1 < bfh1 && fch2 < bfh2) if (fch1 < bfh1 || fch2 < bfh2)
{
// the back sector's ceiling obstructs part of this wall. Todo: Handle the portal case better.
if ((fch1 < bfh1 && fch2 < bfh2) || frontsector->portalflags == PORTAL_SECTOR_CEILING)
{ {
// the back sector's ceiling obstructs part of this wall.
bfh1 = fch1; bfh1 = fch1;
bfh2 = fch2; bfh2 = fch2;
} }
}
if (bfh1 > ffh1 || bfh2 > ffh2) if (bfh1 > ffh1 || bfh2 > ffh2)
{ {