- preparations for using clip planes on line portals.

This commit is contained in:
Christoph Oelckers 2016-04-29 01:48:06 +02:00
commit 21283b18f4
12 changed files with 133 additions and 70 deletions

View file

@ -111,7 +111,7 @@ static void AddLine (seg_t *seg, bool portalclip)
if (portalclip)
{
int clipres = GLRenderer->mCurrentPortal->ClipSeg(seg);
int clipres = GLRenderer->mClipPortal->ClipSeg(seg);
if (clipres == GLPortal::PClip_InFront) return;
}
@ -218,7 +218,7 @@ static void PolySubsector(subsector_t * sub)
{
if (line->linedef)
{
AddLine (line, GLRenderer->mCurrentPortal != NULL);
AddLine (line, GLRenderer->mClipPortal != NULL);
}
line++;
}
@ -313,11 +313,11 @@ static inline void AddLines(subsector_t * sub, sector_t * sector)
{
if (seg->linedef == NULL)
{
if (!(sub->flags & SSECF_DRAWN)) AddLine (seg, GLRenderer->mCurrentPortal != NULL);
if (!(sub->flags & SSECF_DRAWN)) AddLine (seg, GLRenderer->mClipPortal != NULL);
}
else if (!(seg->sidedef->Flags & WALLF_POLYOBJ))
{
AddLine (seg, GLRenderer->mCurrentPortal != NULL);
AddLine (seg, GLRenderer->mClipPortal != NULL);
}
seg++;
}
@ -447,12 +447,12 @@ static void DoSubsector(subsector_t * sub)
fakesector=gl_FakeFlat(sector, &fake, false);
if (GLRenderer->mCurrentPortal)
if (GLRenderer->mClipPortal)
{
int clipres = GLRenderer->mCurrentPortal->ClipSubsector(sub);
int clipres = GLRenderer->mClipPortal->ClipSubsector(sub);
if (clipres == GLPortal::PClip_InFront)
{
line_t *line = GLRenderer->mCurrentPortal->ClipLine();
line_t *line = GLRenderer->mClipPortal->ClipLine();
// The subsector is out of range, but we still have to check lines that lie directly on the boundary and may expose their upper or lower parts.
if (line) AddSpecialPortalLines(sub, fakesector, line);
return;