From 549ff75b9920d31f49fb00ecbf9f226b36461bdc Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 10 May 2020 20:59:18 +1000 Subject: [PATCH] RR: Change horizSkew from fix16_t to int8_t. - No point converting an int to fix16, only to convert it back. It's only ever an unrounded integer. --- source/rr/src/player.cpp | 10 +++++----- source/rr/src/player.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/rr/src/player.cpp b/source/rr/src/player.cpp index 4b5fb92a7..f4a84f512 100644 --- a/source/rr/src/player.cpp +++ b/source/rr/src/player.cpp @@ -3557,7 +3557,7 @@ void P_GetInput(int const playerNum) } if (thisPlayer.horizSkew) - pPlayer->q16horiz = fix16_sadd(pPlayer->q16horiz, fix16_from_dbl(scaleAdjustmentToInterval(fix16_to_dbl(thisPlayer.horizSkew)))); + pPlayer->q16horiz = fix16_sadd(pPlayer->q16horiz, fix16_from_dbl(scaleAdjustmentToInterval(thisPlayer.horizSkew))); pPlayer->q16horiz = fix16_clamp(pPlayer->q16horiz, F16(HORIZ_MIN), F16(HORIZ_MAX)); } @@ -4201,7 +4201,7 @@ void P_DHGetInput(int const playerNum) } if (thisPlayer.horizSkew) - pPlayer->q16horiz = fix16_sadd(pPlayer->q16horiz, fix16_from_dbl(scaleAdjustmentToInterval(fix16_to_dbl(thisPlayer.horizSkew)))); + pPlayer->q16horiz = fix16_sadd(pPlayer->q16horiz, fix16_from_dbl(scaleAdjustmentToInterval(thisPlayer.horizSkew))); pPlayer->q16horiz = fix16_clamp(pPlayer->q16horiz, F16(HORIZ_MIN), F16(HORIZ_MAX)); @@ -8799,7 +8799,7 @@ HORIZONLY:; if (pPlayer->hard_landing > 0) { - thisPlayer.horizSkew = fix16_from_int(-(pPlayer->hard_landing << 4)); + thisPlayer.horizSkew = -(pPlayer->hard_landing << 4); pPlayer->hard_landing--; } @@ -8829,7 +8829,7 @@ HORIZONLY:; if (pPlayer->knee_incs > 0) { - thisPlayer.horizSkew = F16(-48); + thisPlayer.horizSkew = -48; thisPlayer.horizRecenter = true; pPlayer->return_to_center = 9; @@ -9439,7 +9439,7 @@ void P_DHProcessInput(int playerNum) if (pPlayer->hard_landing > 0) { - thisPlayer.horizSkew = fix16_from_int(-(pPlayer->hard_landing << 4)); + thisPlayer.horizSkew = -(pPlayer->hard_landing << 4); pPlayer->hard_landing--; } diff --git a/source/rr/src/player.h b/source/rr/src/player.h index a1c1e88fb..2bd7c4565 100644 --- a/source/rr/src/player.h +++ b/source/rr/src/player.h @@ -235,7 +235,7 @@ typedef struct bool horizRecenter; float horizAngleAdjust; - fix16_t horizSkew; + int8_t horizSkew; int32_t movefifoend, syncvalhead, myminlag; int32_t pcolor, pteam;