Blood: Remove constexpr on player horizon values.

This commit is contained in:
Mitchell Richters 2020-04-01 22:55:36 +11:00 committed by Christoph Oelckers
parent e6420e1eb4
commit 68bf97462a
4 changed files with 17 additions and 17 deletions

View file

@ -387,10 +387,10 @@ void ctrlGetInput(void)
gInput.q16mlook = fix16_clamp(fix16_sadd(gInput.q16mlook, input.q16mlook), fix16_from_int(-127)>>2, fix16_from_int(127)>>2); gInput.q16mlook = fix16_clamp(fix16_sadd(gInput.q16mlook, input.q16mlook), fix16_from_int(-127)>>2, fix16_from_int(127)>>2);
if (gMe && gMe->pXSprite->health != 0 && !gPaused) if (gMe && gMe->pXSprite->health != 0 && !gPaused)
{ {
constexpr int upAngle = 289; int upAngle = 289;
constexpr int downAngle = -347; int downAngle = -347;
constexpr double lookStepUp = 4.0*upAngle/60.0; double lookStepUp = 4.0*upAngle/60.0;
constexpr double lookStepDown = -4.0*downAngle/60.0; double lookStepDown = -4.0*downAngle/60.0;
gViewAngle = (gViewAngle + input.q16turn + fix16_from_float(scaleAdjustmentToInterval(gViewAngleAdjust))) & 0x7ffffff; gViewAngle = (gViewAngle + input.q16turn + fix16_from_float(scaleAdjustmentToInterval(gViewAngleAdjust))) & 0x7ffffff;
if (gViewLookRecenter) if (gViewLookRecenter)
{ {

View file

@ -1204,9 +1204,9 @@ void trPlayerCtrlSetScreenEffect(XSPRITE* pXSource, PLAYER* pPlayer) {
void trPlayerCtrlSetLookAngle(XSPRITE* pXSource, PLAYER* pPlayer) { void trPlayerCtrlSetLookAngle(XSPRITE* pXSource, PLAYER* pPlayer) {
constexpr int upAngle = 289; constexpr int downAngle = -347; int upAngle = 289; int downAngle = -347;
constexpr double lookStepUp = 4.0 * upAngle / 60.0; double lookStepUp = 4.0 * upAngle / 60.0;
constexpr double lookStepDown = -4.0 * downAngle / 60.0; double lookStepDown = -4.0 * downAngle / 60.0;
int look = pXSource->data2 << 5; int look = pXSource->data2 << 5;
if (look > 0) pPlayer->q16look = fix16_min(mulscale8(fix16_from_dbl(lookStepUp), look), fix16_from_int(upAngle)); if (look > 0) pPlayer->q16look = fix16_min(mulscale8(fix16_from_dbl(lookStepUp), look), fix16_from_int(upAngle));

View file

@ -1574,10 +1574,10 @@ void ProcessInput(PLAYER *pPlayer)
} }
else else
{ {
constexpr int upAngle = 289; int upAngle = 289;
constexpr int downAngle = -347; int downAngle = -347;
constexpr double lookStepUp = 4.0*upAngle/60.0; double lookStepUp = 4.0*upAngle/60.0;
constexpr double lookStepDown = -4.0*downAngle/60.0; double lookStepDown = -4.0*downAngle/60.0;
if (pInput->keyFlags.lookCenter && !pInput->buttonFlags.lookUp && !pInput->buttonFlags.lookDown) if (pInput->keyFlags.lookCenter && !pInput->buttonFlags.lookUp && !pInput->buttonFlags.lookDown)
{ {
if (pPlayer->q16look < 0) if (pPlayer->q16look < 0)

View file

@ -456,10 +456,10 @@ void fakeProcessInput(PLAYER *pPlayer, GINPUT *pInput)
else else
predict.at24 = 0; predict.at24 = 0;
#endif #endif
constexpr int upAngle = 289; int upAngle = 289;
constexpr int downAngle = -347; int downAngle = -347;
constexpr double lookStepUp = 4.0*upAngle/60.0; double lookStepUp = 4.0*upAngle/60.0;
constexpr double lookStepDown = -4.0*downAngle/60.0; double lookStepDown = -4.0*downAngle/60.0;
if (predict.at6e && !pInput->buttonFlags.lookUp && !pInput->buttonFlags.lookDown) if (predict.at6e && !pInput->buttonFlags.lookUp && !pInput->buttonFlags.lookDown)
{ {
if (predict.at20 < 0) if (predict.at20 < 0)
@ -3189,8 +3189,8 @@ void viewDrawScreen(bool sceneonly)
} }
if (gView == gMe && (numplayers <= 1 || gPrediction) && gView->pXSprite->health != 0 && !VanillaMode()) if (gView == gMe && (numplayers <= 1 || gPrediction) && gView->pXSprite->health != 0 && !VanillaMode())
{ {
constexpr int upAngle = 289; int upAngle = 289;
constexpr int downAngle = -347; int downAngle = -347;
fix16_t q16look; fix16_t q16look;
cA = gViewAngle; cA = gViewAngle;
q16look = gViewLook; q16look = gViewLook;