Revert "clean this up a little"

This reverts commit 99c9d921e3ab3ee3fde3dcf141e20323e064902a.
This commit is contained in:
Alug committed 2024-02-01 02:03:23 +01:00
1 parent e063345c4b
commit 623fab8ea8
2 files changed
+27 -25

No files matched your search

+25 -24
View File
@@ -3731,39 +3731,40 @@ 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
static boolean HWR_PortalCheckPointSide(fixed_t x, fixed_t y)
static boolean HWR_PortalCheckBBox(fixed_t *bspcoord)
{
// we are checking if the point is on the viewable side of the portal exit.
vertex_t closest_point;
if (!portalclipline)
return true;
// we are looking for a bounding box corner that is on the viewable side of the portal exit.
// being exactly on the portal exit line is not enough to pass the test.
// P_PointOnLineSide could behave differently from this expectation on this case,
// so first check if the point is precisely on the line, and then if not, check the side.
vertex_t closest_point;
P_ClosestPointOnLine(x, y, gl_portalclipline, &closest_point);
if (closest_point.x != x || closest_point.y != y)
P_ClosestPointOnLine(bspcoord[BOXLEFT], bspcoord[BOXTOP], portalclipline, &closest_point);
if (closest_point.x != bspcoord[BOXLEFT] || closest_point.y != bspcoord[BOXTOP])
{
if (P_PointOnLineSide(x, y, gl_portalclipline) != gl_portalviewside)
if (P_PointOnLineSide(bspcoord[BOXLEFT], bspcoord[BOXTOP], portalclipline) != portalviewside)
return true;
}
return false;
}
// Check if bounding box is (partially or fully) in the correct side
// of the portal destination.
static boolean HWR_PortalCheckBBox(fixed_t *bspcoord)
{
if (!portalclipline)
return true;
if (HWR_PortalCheckPointSide(bspcoord[BOXLEFT], bspcoord[BOXTOP]) ||
HWR_PortalCheckPointSide(bspcoord[BOXLEFT], bspcoord[BOXBOTTOM]) ||
HWR_PortalCheckPointSide(bspcoord[BOXRIGHT], bspcoord[BOXTOP]) ||
HWR_PortalCheckPointSide(bspcoord[BOXRIGHT], bspcoord[BOXBOTTOM]))
P_ClosestPointOnLine(bspcoord[BOXLEFT], bspcoord[BOXBOTTOM], portalclipline, &closest_point);
if (closest_point.x != bspcoord[BOXLEFT] || closest_point.y != bspcoord[BOXBOTTOM])
{
return true;
if (P_PointOnLineSide(bspcoord[BOXLEFT], bspcoord[BOXBOTTOM], portalclipline) != portalviewside)
return true;
}
P_ClosestPointOnLine(bspcoord[BOXRIGHT], bspcoord[BOXTOP], portalclipline, &closest_point);
if (closest_point.x != bspcoord[BOXRIGHT] || closest_point.y != bspcoord[BOXTOP])
{
if (P_PointOnLineSide(bspcoord[BOXRIGHT], bspcoord[BOXTOP], portalclipline) != portalviewside)
return true;
}
P_ClosestPointOnLine(bspcoord[BOXRIGHT], bspcoord[BOXBOTTOM], portalclipline, &closest_point);
if (closest_point.x != bspcoord[BOXRIGHT] || closest_point.y != bspcoord[BOXBOTTOM])
{
if (P_PointOnLineSide(bspcoord[BOXRIGHT], bspcoord[BOXBOTTOM], portalclipline) != portalviewside)
return true;
}
// we did not find any reason to pass the check, so return failure
+2 -1
View File
@@ -1038,7 +1038,6 @@ void SetStates(void)
pglColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
pglEnable(GL_STENCIL_TEST);
pglEnable(GL_DEPTH_TEST); // check the depth buffer
pglDepthMask(GL_TRUE); // enable writing to depth buffer
pglClearDepth(1.0f);
@@ -1058,6 +1057,8 @@ void SetStates(void)
pglLoadIdentity();
pglScalef(1.0f, 1.0f, -1.0f);
pglGetFloatv(GL_MODELVIEW_MATRIX, modelMatrix); // added for new coronas' code (without depth buffer)
pglEnable(GL_STENCIL_TEST);
}
void GLFramebuffer_Generate(void)