mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-30 21:20:54 +00:00
Merge branch 'portalcullsector' into 'master'
Restore portal culling code that went gone by pure accident See merge request STJr/SRB2!523
This commit is contained in:
commit
64eb89fc56
4 changed files with 12 additions and 0 deletions
|
@ -1378,5 +1378,13 @@ void R_RenderBSPNode(INT32 bspnum)
|
||||||
bspnum = bsp->children[side^1];
|
bspnum = bsp->children[side^1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PORTAL CULLING
|
||||||
|
if (portalcullsector) {
|
||||||
|
sector_t *sect = subsectors[bspnum & ~NF_SUBSECTOR].sector;
|
||||||
|
if (sect != portalcullsector)
|
||||||
|
return;
|
||||||
|
portalcullsector = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
R_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR);
|
R_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1008,11 +1008,13 @@ static void R_PortalFrame(portal_t *portal)
|
||||||
if (portal->clipline != -1)
|
if (portal->clipline != -1)
|
||||||
{
|
{
|
||||||
portalclipline = &lines[portal->clipline];
|
portalclipline = &lines[portal->clipline];
|
||||||
|
portalcullsector = portalclipline->frontsector;
|
||||||
viewsector = portalclipline->frontsector;
|
viewsector = portalclipline->frontsector;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
portalclipline = NULL;
|
portalclipline = NULL;
|
||||||
|
portalcullsector = NULL;
|
||||||
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
viewsector = R_PointInSubsector(viewx, viewy)->sector;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ UINT8 portalrender; /**< When rendering a portal, it establishes the depth of
|
||||||
portal_t *portal_base, *portal_cap;
|
portal_t *portal_base, *portal_cap;
|
||||||
|
|
||||||
line_t *portalclipline;
|
line_t *portalclipline;
|
||||||
|
sector_t *portalcullsector;
|
||||||
INT32 portalclipstart, portalclipend;
|
INT32 portalclipstart, portalclipend;
|
||||||
|
|
||||||
boolean portalline; // is curline a portal seg?
|
boolean portalline; // is curline a portal seg?
|
||||||
|
|
|
@ -45,6 +45,7 @@ extern portal_t* portal_cap;
|
||||||
extern UINT8 portalrender;
|
extern UINT8 portalrender;
|
||||||
|
|
||||||
extern line_t *portalclipline;
|
extern line_t *portalclipline;
|
||||||
|
extern sector_t *portalcullsector;
|
||||||
extern INT32 portalclipstart, portalclipend;
|
extern INT32 portalclipstart, portalclipend;
|
||||||
|
|
||||||
void Portal_InitList (void);
|
void Portal_InitList (void);
|
||||||
|
|
Loading…
Reference in a new issue