- moved R_AlignFlat out of renderer into main game code (r_ to p_.)
SVN r3249 (trunk)
This commit is contained in:
parent
17ed7aaabd
commit
b57a39dd86
9 changed files with 39 additions and 352 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "p_spec.h"
|
||||
#include "c_cvars.h"
|
||||
#include "doomstat.h"
|
||||
#include "r_main.h"
|
||||
#include "resources/colormaps.h"
|
||||
|
||||
|
||||
|
|
@ -771,3 +772,36 @@ bool sector_t::PlaneMoving(int pos)
|
|||
else
|
||||
return (ceilingdata != NULL || (planes[ceiling].Flags & PLANEF_BLOCKED));
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// P_AlignFlat
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
bool P_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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue