- gameinput.cpp: Make sethorizon(), applylook() and calcviewpitch() class functions of PlayerHorizon and PlayerAngle where appropriate.

This commit is contained in:
Mitchell Richters 2021-04-19 20:50:01 +10:00
parent 171d541112
commit de06030ea0
11 changed files with 62 additions and 60 deletions

View file

@ -1516,7 +1516,7 @@ UpdatePlayerSpriteAngle(PLAYERp pp)
void
DoPlayerTurn(PLAYERp pp, float const avel, double const scaleAdjust)
{
applylook(&pp->angle, avel, &pp->input.actions, scaleAdjust);
pp->angle.applylook(avel, &pp->input.actions, scaleAdjust);
UpdatePlayerSpriteAngle(pp);
}
@ -1667,8 +1667,8 @@ void
DoPlayerHorizon(PLAYERp pp, float const horz, double const scaleAdjust)
{
bool const canslopetilt = !TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING) && TEST(sector[pp->cursectnum].floorstat, FLOOR_STAT_SLOPE);
calcviewpitch(pp->pos.vec2, &pp->horizon.horizoff, pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursectnum, scaleAdjust, TEST(pp->Flags, PF_CLIMBING));
sethorizon(&pp->horizon, horz, &pp->input.actions, scaleAdjust);
pp->horizon.calcviewpitch(pp->pos.vec2, pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursectnum, scaleAdjust, TEST(pp->Flags, PF_CLIMBING));
pp->horizon.sethorizon(horz, &pp->input.actions, scaleAdjust);
}
void