- floatified vertices and removed the now redundant fx and fy members. This needs an added check for polyobject origins, though, so that such subsectors don't get rendered.

This commit is contained in:
Christoph Oelckers 2016-04-03 11:40:14 +02:00
commit 5a2eac8f15
9 changed files with 67 additions and 70 deletions

View file

@ -396,7 +396,6 @@ void R_SetView()
angle_t R_PointToPseudoAngle (fixed_t x, fixed_t y)
{
// Note: float won't work here as it's less precise than the BAM values being passed as parameters
double vecx = double(x-viewx);
double vecy = double(y-viewy);
@ -416,6 +415,26 @@ angle_t R_PointToPseudoAngle (fixed_t x, fixed_t y)
}
angle_t R_PointToPseudoAngle(double x, double y)
{
double vecx = x - ViewPos.X;
double vecy = y - ViewPos.Y;
if (vecx == 0 && vecy == 0)
{
return 0;
}
else
{
double result = vecy / (fabs(vecx) + fabs(vecy));
if (vecx < 0)
{
result = 2.f - result;
}
return xs_Fix<30>::ToFix(result);
}
}
//-----------------------------------------------------------------------------