Revert "replace check"
This reverts commit 36eaaee202c4d1f7e86dd2b24dcfe5573ac2f280.
This commit is contained in:
1 parent
d232e0e2c6
commit
27533a1dcd
2 files changed
+25
-8
No files matched your search
+25
-7
@@ -2881,13 +2881,30 @@ void HWR_AddLine(seg_t *line)
|
||||
angle1 = R_PointToPseudoAngle(v1x, v1y);
|
||||
angle2 = R_PointToPseudoAngle(v2x, v2y);
|
||||
|
||||
// do extra checks on the seg when rendering portals:
|
||||
// don't render segs that are behind the portal destination line
|
||||
if (portalclipline && gr_portal !=
|
||||
!HWR_PortalCheckPointSide(line->v1->x, line->v1->y) &&
|
||||
!HWR_PortalCheckPointSide(line->v2->x, line->v2->y))
|
||||
// do an extra culling check when rendering portals
|
||||
// check if any line vertex is on the viewable side of the portal target line
|
||||
// if not, the line can be culled.
|
||||
if (portalclipline)// portalclipline should be NULL when we are not rendering portal contents
|
||||
{
|
||||
return;
|
||||
vertex_t closest_point;
|
||||
boolean pass = false;
|
||||
|
||||
// similar idea than in PortalCheckBBox, but checking the line vertices instead
|
||||
// TODO could make the check more efficient and not check anything if pass==true from earlier or something
|
||||
P_ClosestPointOnLine(line->v1->x, line->v1->y, portalclipline, &closest_point);
|
||||
if (closest_point.x != line->v1->x || closest_point.y != line->v1->y)
|
||||
{
|
||||
if (P_PointOnLineSide(line->v1->x, line->v1->y, portalclipline) != portalviewside)
|
||||
pass = true;
|
||||
}
|
||||
P_ClosestPointOnLine(line->v2->x, line->v2->y, portalclipline, &closest_point);
|
||||
if (closest_point.x != line->v2->x || closest_point.y != line->v2->y)
|
||||
{
|
||||
if (P_PointOnLineSide(line->v2->x, line->v2->y, portalclipline) != portalviewside)
|
||||
pass = true;
|
||||
}
|
||||
if (!pass)
|
||||
return;
|
||||
}
|
||||
|
||||
if (gr_portal == GRPORTAL_STENCIL || gr_portal == GRPORTAL_DEPTH)
|
||||
@@ -3714,9 +3731,10 @@ skip_stuff_for_portals:
|
||||
// use returned value as multiplier for the added values from p_thrust thing
|
||||
// P_InterceptVector needs divlines which need dx and dy, dx=x2-x1 dy=y2-y1
|
||||
|
||||
|
||||
// returns true if the point is on the correct (viewable) side of the
|
||||
// portal destination line
|
||||
boolean HWR_PortalCheckPointSide(fixed_t x, fixed_t y)
|
||||
static boolean HWR_PortalCheckPointSide(fixed_t x, fixed_t y)
|
||||
{
|
||||
// we are checking if the point is on the viewable side of the portal exit.
|
||||
// being exactly on the portal exit line is not enough to pass the test.
|
||||
|
||||
@@ -89,7 +89,6 @@ void HWR_SetViewSize(void);
|
||||
void HWR_AddCommands(void);
|
||||
void HWR_SetTransform(float fpov, player_t *player);
|
||||
void HWR_ClearClipper(void);
|
||||
boolean HWR_PortalCheckPointSide(fixed_t x, fixed_t y);
|
||||
|
||||
boolean HWR_UseShader(void);
|
||||
boolean HWR_ShouldUsePaletteRendering(void);
|
||||
|
||||
Reference in new issue
Block a user