mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- replaced AM_Rotate with a more precise floating point version posted by Entryway.
SVN r2713 (trunk)
This commit is contained in:
parent
31754a582d
commit
ce2c2bd825
1 changed files with 11 additions and 6 deletions
|
@ -1938,14 +1938,19 @@ void AM_drawWalls (bool allmap)
|
||||||
//
|
//
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
void AM_rotate (fixed_t *x, fixed_t *y, angle_t a)
|
void AM_rotate(fixed_t *xp, fixed_t *yp, angle_t a)
|
||||||
{
|
{
|
||||||
fixed_t tmpx;
|
double x = FIXED2FLOAT(*xp);
|
||||||
|
double y = FIXED2FLOAT(*yp);
|
||||||
|
double rot = (double)a / (double)(1u << 31) * (double)M_PI;
|
||||||
|
double sinrot = sin(rot);
|
||||||
|
double cosrot = cos(rot);
|
||||||
|
|
||||||
a >>= ANGLETOFINESHIFT;
|
double tmpx = (x * cosrot) - (y * sinrot);
|
||||||
tmpx = DMulScale16 (*x,finecosine[a],*y,-finesine[a]);
|
y = (x * sinrot) + (y * cosrot);
|
||||||
*y = DMulScale16 (*x,finesine[a],*y,finecosine[a]);
|
x = tmpx;
|
||||||
*x = tmpx;
|
*xp = FLOAT2FIXED(x);
|
||||||
|
*yp = FLOAT2FIXED(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
Loading…
Reference in a new issue