Replace portalline boolean with g_portal pointer to current portal

This commit is contained in:
James R 2023-04-02 23:08:23 -07:00
parent d84ee59887
commit 20692de47a
4 changed files with 7 additions and 5 deletions

View file

@ -449,7 +449,7 @@ static void R_AddLine(seg_t *line)
static sector_t tempsec;
boolean bothceilingssky = false, bothfloorssky = false;
portalline = false;
g_portal = NULL;
if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES))
return;

View file

@ -14,6 +14,8 @@
#ifndef __R_BSP__
#define __R_BSP__
#include "typedef.h"
#ifdef __cplusplus
extern "C" {
#endif
@ -27,7 +29,7 @@ extern side_t *sidedef;
extern line_t *linedef;
extern sector_t *frontsector;
extern sector_t *backsector;
extern boolean portalline; // is curline a portal seg?
extern portal_t *g_portal; // is curline a portal seg?
// drawsegs are allocated on the fly... see r_segs.c

View file

@ -30,7 +30,7 @@ line_t *portalclipline;
sector_t *portalcullsector;
INT32 portalclipstart, portalclipend;
boolean portalline; // is curline a portal seg?
portal_t *g_portal; // is curline a portal seg?
void Portal_InitList (void)
{
@ -189,7 +189,7 @@ void Portal_Add2Lines (const INT32 line1, const INT32 line2, const INT32 x1, con
Portal_ClipRange(portal);
portalline = true; // this tells R_StoreWallRange that curline is a portal seg
g_portal = portal; // this tells R_StoreWallRange that curline is a portal seg
}
/** Store the clipping window for a portal using a visplane.

View file

@ -2973,7 +2973,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
R_RenderSegLoop();
R_SetColumnFunc(BASEDRAWFUNC, false);
if (portalline) // if curline is a portal, set portalrender for drawseg
if (g_portal) // if curline is a portal, set portalrender for drawseg
ds_p->portalpass = portalrender+1;
else
ds_p->portalpass = 0;