From 4dec0ce25f712f6f25557776d746dca727dec973 Mon Sep 17 00:00:00 2001 From: Julia Nechaevskaya Date: Wed, 29 Jun 2022 09:55:19 +0300 Subject: [PATCH] Keep arrow stable in non-rotate mode (#634) * Keep arrow stable in non-rotate mode * Erm, more human-readable condition --- src/am_map.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 0733dfa7..15a004bf 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -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; } }