From ae353b93fba5859686cb3698a33c20fcf91409f7 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 10 May 2020 17:09:35 +1000 Subject: [PATCH] Duke3D: 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/duke3d/src/player.cpp | 6 +++--- source/duke3d/src/player.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 7eae47504..7e77fd03f 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -3374,7 +3374,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)); } @@ -5747,7 +5747,7 @@ RECHECK: if (pPlayer->hard_landing > 0) { - thisPlayer.horizSkew = fix16_from_int(-(pPlayer->hard_landing << 4)); + thisPlayer.horizSkew = -(pPlayer->hard_landing << 4); pPlayer->hard_landing--; } @@ -5776,7 +5776,7 @@ RECHECK: #ifndef EDUKE32_STANDALONE if (!FURY && pPlayer->knee_incs > 0) { - thisPlayer.horizSkew = F16(-48); + thisPlayer.horizSkew = -48; thisPlayer.horizRecenter = true; pPlayer->return_to_center = 9; diff --git a/source/duke3d/src/player.h b/source/duke3d/src/player.h index d2a13d24e..9fb02977e 100644 --- a/source/duke3d/src/player.h +++ b/source/duke3d/src/player.h @@ -230,7 +230,7 @@ typedef struct bool horizRecenter; float horizAngleAdjust; - fix16_t horizSkew; + int8_t horizSkew; int32_t netsynctime; int16_t ping, filler;