- moved R_AlignFlat out of renderer into main game code (r_ to p_.)

SVN r3249 (trunk)
This commit is contained in:
Christoph Oelckers 2011-07-05 13:33:02 +00:00
commit b57a39dd86
9 changed files with 39 additions and 352 deletions

View file

@ -1787,35 +1787,3 @@ bool R_PlaneInitData ()
return true;
}
//==========================================================================
//
// R_AlignFlat
//
//==========================================================================
bool R_AlignFlat (int linenum, int side, int fc)
{
line_t *line = lines + linenum;
sector_t *sec = side ? line->backsector : line->frontsector;
if (!sec)
return false;
fixed_t x = line->v1->x;
fixed_t y = line->v1->y;
angle_t angle = R_PointToAngle2 (x, y, line->v2->x, line->v2->y);
angle_t norm = (angle-ANGLE_90) >> ANGLETOFINESHIFT;
fixed_t dist = -DMulScale16 (finecosine[norm], x, finesine[norm], y);
if (side)
{
angle = angle + ANGLE_180;
dist = -dist;
}
sec->SetBase(fc, dist & ((1<<(FRACBITS+8))-1), 0-angle);
return true;
}