Skip to content

Commit

Permalink
Blood: Remove constexpr on player horizon values.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr4077au authored and coelckers committed Apr 1, 2020
1 parent e6420e1 commit 68bf974
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions source/blood/src/controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (gMe && gMe->pXSprite->health != 0 && !gPaused)
{
constexpr int upAngle = 289;
constexpr int downAngle = -347;
constexpr double lookStepUp = 4.0*upAngle/60.0;
constexpr double lookStepDown = -4.0*downAngle/60.0;
int upAngle = 289;
int downAngle = -347;
double lookStepUp = 4.0*upAngle/60.0;
double lookStepDown = -4.0*downAngle/60.0;
gViewAngle = (gViewAngle + input.q16turn + fix16_from_float(scaleAdjustmentToInterval(gViewAngleAdjust))) & 0x7ffffff;
if (gViewLookRecenter)
{
Expand Down
6 changes: 3 additions & 3 deletions source/blood/src/nnexts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1204,9 +1204,9 @@ void trPlayerCtrlSetScreenEffect(XSPRITE* pXSource, PLAYER* pPlayer) {

void trPlayerCtrlSetLookAngle(XSPRITE* pXSource, PLAYER* pPlayer) {

constexpr int upAngle = 289; constexpr int downAngle = -347;
constexpr double lookStepUp = 4.0 * upAngle / 60.0;
constexpr double lookStepDown = -4.0 * downAngle / 60.0;
int upAngle = 289; int downAngle = -347;
double lookStepUp = 4.0 * upAngle / 60.0;
double lookStepDown = -4.0 * downAngle / 60.0;

int look = pXSource->data2 << 5;
if (look > 0) pPlayer->q16look = fix16_min(mulscale8(fix16_from_dbl(lookStepUp), look), fix16_from_int(upAngle));
Expand Down
8 changes: 4 additions & 4 deletions source/blood/src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1574,10 +1574,10 @@ void ProcessInput(PLAYER *pPlayer)
}
else
{
constexpr int upAngle = 289;
constexpr int downAngle = -347;
constexpr double lookStepUp = 4.0*upAngle/60.0;
constexpr double lookStepDown = -4.0*downAngle/60.0;
int upAngle = 289;
int downAngle = -347;
double lookStepUp = 4.0*upAngle/60.0;
double lookStepDown = -4.0*downAngle/60.0;
if (pInput->keyFlags.lookCenter && !pInput->buttonFlags.lookUp && !pInput->buttonFlags.lookDown)
{
if (pPlayer->q16look < 0)
Expand Down
12 changes: 6 additions & 6 deletions source/blood/src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,10 @@ void fakeProcessInput(PLAYER *pPlayer, GINPUT *pInput)
else
predict.at24 = 0;
#endif
constexpr int upAngle = 289;
constexpr int downAngle = -347;
constexpr double lookStepUp = 4.0*upAngle/60.0;
constexpr double lookStepDown = -4.0*downAngle/60.0;
int upAngle = 289;
int downAngle = -347;
double lookStepUp = 4.0*upAngle/60.0;
double lookStepDown = -4.0*downAngle/60.0;
if (predict.at6e && !pInput->buttonFlags.lookUp && !pInput->buttonFlags.lookDown)
{
if (predict.at20 < 0)
Expand Down Expand Up @@ -3189,8 +3189,8 @@ void viewDrawScreen(bool sceneonly)
}
if (gView == gMe && (numplayers <= 1 || gPrediction) && gView->pXSprite->health != 0 && !VanillaMode())
{
constexpr int upAngle = 289;
constexpr int downAngle = -347;
int upAngle = 289;
int downAngle = -347;
fix16_t q16look;
cA = gViewAngle;
q16look = gViewLook;
Expand Down

0 comments on commit 68bf974

Please sign in to comment.