mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-11 13:11:48 +00:00
- fixed compilation.
This commit is contained in:
parent
ec4b3da93d
commit
7ceb6d86dd
1 changed files with 4 additions and 31 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue