Keep arrow stable in non-rotate mode (#634)

* Keep arrow stable in non-rotate mode

* Erm, more human-readable condition
This commit is contained in:
Julia Nechaevskaya 2022-06-29 09:55:19 +03:00 committed by GitHub
parent 7b09a40fe3
commit 4dec0ce25f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1667,16 +1667,18 @@ void AM_rotate
static void AM_rotatePoint(mpoint_t *pt)
{
int64_t tmpx;
// [crispy] smooth automap rotation
const angle_t smoothangle = (followplayer || !automapoverlay) ? ANG90 - viewangle : mapangle;
pt->x -= mapcenter.x;
pt->y -= mapcenter.y;
tmpx = (int64_t)FixedMul(pt->x, finecosine[mapangle>>ANGLETOFINESHIFT])
- (int64_t)FixedMul(pt->y, finesine[mapangle>>ANGLETOFINESHIFT])
tmpx = (int64_t)FixedMul(pt->x, finecosine[smoothangle>>ANGLETOFINESHIFT])
- (int64_t)FixedMul(pt->y, finesine[smoothangle>>ANGLETOFINESHIFT])
+ mapcenter.x;
pt->y = (int64_t)FixedMul(pt->x, finesine[mapangle>>ANGLETOFINESHIFT])
+ (int64_t)FixedMul(pt->y, finecosine[mapangle>>ANGLETOFINESHIFT])
pt->y = (int64_t)FixedMul(pt->x, finesine[smoothangle>>ANGLETOFINESHIFT])
+ (int64_t)FixedMul(pt->y, finecosine[smoothangle>>ANGLETOFINESHIFT])
+ mapcenter.y;
pt->x = tmpx;
@ -2073,7 +2075,7 @@ void AM_Drawer (void)
// if not following the player
if (followplayer || !automapoverlay)
{
mapangle = ANG90 - viewangle;
mapangle = ANG90 - plr->mo->angle;
}
}