- changed mirror handling so that it works without attaching a portal to the mirror line and removed line_t::portal_mirror member.

- did some cleanup on the portal interface on linedefs: All checks should go through isLinePortal (gameplay related) and isVisualPortal (renderer related) which then can decide on the actual data what to return.
- removed portal_passive because it won't survive the upcoming refactoring.
- removed all direct access to portal members of line_t.
- always use the precise (and fast) version of P_PointOnLineSide inside the renderer.
This commit is contained in:
Christoph Oelckers 2016-02-05 16:14:45 +01:00
commit a85a8c1465
5 changed files with 34 additions and 40 deletions

View file

@ -80,14 +80,7 @@ bool P_ClipLineToPortal(line_t* line, line_t* portal, fixed_t viewx, fixed_t vie
bool P_CheckPortal(line_t* line)
{
if (line->special == Line_Mirror)
{
line->portal = true;
line->portal_mirror = true;
line->portal_passive = true;
line->portal_dst = line;
}
else if (line->special == Line_SetPortal)
if (line->special == Line_SetPortal)
{
// portal destination is special argument #0
line_t* dst = NULL;
@ -110,28 +103,18 @@ bool P_CheckPortal(line_t* line)
if (dst)
{
line->portal = true;
line->portal_mirror = false;
line->portal_passive = true;// !!(line->args[2] & PORTAL_VISUAL; (line->special == Line_SetVisualPortal);
line->portal_dst = dst;
line->_portal = true;
//line->portal_passive = true;// !!(line->args[2] & PORTAL_VISUAL; (line->special == Line_SetVisualPortal);
line->_portal_dst = dst;
}
else
{
line->portal = false;
line->portal_mirror = false;
line->portal_passive = false;
line->portal_dst = NULL;
line->_portal = false;
//line->portal_passive = false;
line->_portal_dst = NULL;
}
}
else
{
line->portal = false;
line->portal_mirror = false;
line->portal_passive = false;
line->portal_dst = NULL;
}
return (line->portal);
return (line->_portal);
}
void P_TranslatePortalXY(line_t* src, line_t* dst, fixed_t& x, fixed_t& y)
@ -297,12 +280,12 @@ bool PortalTracer::TraceStep()
{
li = in->d.line;
if (li->portal && !li->portal_passive)
if (li->isLinePortal())
{
if (P_PointOnLineSide(startx-dirx, starty-diry, li))
continue; // we're at the back side of this line
line_t* out = li->portal_dst;
line_t* out = li->getPortalDestination();
this->in = li;
this->out = out;