From 7ceb6d86dd2ea769f2b09dcaa7e47b4edca35667 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 4 Mar 2016 10:39:10 +0100 Subject: [PATCH] - fixed compilation. --- src/gl/scene/gl_portal.cpp | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index a186d4ff02..106bf4828f 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -952,16 +952,7 @@ void GLMirrorPortal::DrawContents() int GLMirrorPortal::ClipSeg(seg_t *seg) { - //we cannot use P_PointOnLineSide here because it loses the special meaning of 0 == 'on the line'. - int side1 = DMulScale32(seg->v1->y - linedef->v1->y, linedef->dx, linedef->v1->x - seg->v1->x, linedef->dy); - int side2 = DMulScale32(seg->v2->y - linedef->v1->y, linedef->dx, linedef->v1->x - seg->v2->x, linedef->dy); - - if (side1 >= 0 && side2 >= 0) - // this seg is completely behind the mirror. - { - return PClip_InFront; - } - return PClip_Inside; + return P_ClipLineToPortal(seg->linedef, linedef, viewx, viewy) ? PClip_InFront : PClip_Inside; } int GLMirrorPortal::ClipSubsector(subsector_t *sub) @@ -994,25 +985,6 @@ int GLMirrorPortal::ClipPoint(fixed_t x, fixed_t y) //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -static void glTranslatePortal(line_t* src, line_t* dst, fixed_t& x, fixed_t& y, angle_t & angle) -{ - // Get the angle between the two linedefs, for rotating - // orientation and velocity. Rotate 180 degrees, and flip - // the position across the exit linedef, if reversed. - - double xangle = atan2(double(dst->dy), double(dst->dx)) - atan2(double(src->dy), double(src->dx)) + M_PI; - double s = sin(xangle); - double c = cos(xangle); - - fixed_t nposx = x - src->v1->x; - fixed_t nposy = y - src->v1->y; - - // Rotate position along normal to match exit linedef - x = xs_RoundToInt(nposx * c - nposy * s) + dst->v2->x; - y = xs_RoundToInt(nposy * c + nposx * s) + dst->v2->y; - angle += xs_CRoundToInt(xangle * (ANGLE_180 / M_PI)); -} - void GLLineToLineInfo::init(line_t *line) { static const divline_t divlx = { 0, 0, 128 * FRACUNIT, 0 }; @@ -1030,8 +1002,9 @@ void GLLineToLineInfo::init(line_t *line) viewy = ::viewy; viewz = ::viewz; viewangle = ::viewangle; - glTranslatePortal(line, line->getPortalDestination(), viewx, viewy, viewangle); - P_TranslatePortalZ(line, line->getPortalDestination(), viewz); + P_TranslatePortalXY(line, viewx, viewy); + P_TranslatePortalAngle(line, viewangle); + P_TranslatePortalZ(line, viewz); }