diff --git a/source/core/gameinput.cpp b/source/core/gameinput.cpp index 5ea5aaf67..adcbe157e 100644 --- a/source/core/gameinput.cpp +++ b/source/core/gameinput.cpp @@ -173,7 +173,7 @@ void processMovement(InputPacket* const currInput, InputPacket* const inputBuffe // //--------------------------------------------------------------------------- -void PlayerHorizon::applyinput(float const horz, ESyncBits* actions, double const scaleAdjust) +void PlayerHorizon::applyPitch(float const horz, ESyncBits* actions, double const scaleAdjust) { // Process only if movement isn't locked. if (!lockedPitch()) @@ -277,7 +277,7 @@ void PlayerAngle::applyinput(float const avel, ESyncBits* actions, double const // //--------------------------------------------------------------------------- -void PlayerHorizon::calcviewpitch(const DVector2& pos, DAngle const ang, bool const aimmode, bool const canslopetilt, sectortype* const cursectnum, double const scaleAdjust, bool const climbing) +void PlayerHorizon::doViewPitch(const DVector2& pos, DAngle const ang, bool const aimmode, bool const canslopetilt, sectortype* const cursectnum, double const scaleAdjust, bool const climbing) { if (cl_slopetilting && cursectnum != nullptr) { diff --git a/source/core/gameinput.h b/source/core/gameinput.h index 7055b8c4c..f2859fa9d 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -13,8 +13,8 @@ struct PlayerHorizon friend FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerHorizon& w, PlayerHorizon* def); // Prototypes for functions in gameinput.cpp. - void applyinput(float const horz, ESyncBits* actions, double const scaleAdjust = 1); - void calcviewpitch(const DVector2& pos, DAngle const ang, bool const aimmode, bool const canslopetilt, sectortype* const cursectnum, double const scaleAdjust = 1, bool const climbing = false); + void applyPitch(float const horz, ESyncBits* actions, double const scaleAdjust = 1); + void doViewPitch(const DVector2& pos, DAngle const ang, bool const aimmode, bool const canslopetilt, sectortype* const cursectnum, double const scaleAdjust = 1, bool const climbing = false); // Interpolation helpers. void backupPitch() diff --git a/source/games/blood/src/controls.cpp b/source/games/blood/src/controls.cpp index d17d2fcdc..7b6d7a4b9 100644 --- a/source/games/blood/src/controls.cpp +++ b/source/games/blood/src/controls.cpp @@ -63,7 +63,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju if (pPlayer->actor->xspr.health != 0) { pPlayer->angle.applyinput(input.avel, &pPlayer->input.actions, scaleAdjust); - pPlayer->horizon.applyinput(input.horz, &pPlayer->input.actions, scaleAdjust); + pPlayer->horizon.applyPitch(input.horz, &pPlayer->input.actions, scaleAdjust); doslopetilting(pPlayer, scaleAdjust); } diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index d697f1f38..6680a6b12 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1513,7 +1513,7 @@ void doslopetilting(PLAYER* pPlayer, double const scaleAdjust = 1) auto plActor = pPlayer->actor; int const florhit = pPlayer->actor->hit.florhit.type; bool const va = plActor->xspr.height < 16 && (florhit == kHitSector || florhit == 0) ? 1 : 0; - pPlayer->horizon.calcviewpitch(plActor->spr.pos.XY(), plActor->spr.Angles.Yaw, va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust); + pPlayer->horizon.doViewPitch(plActor->spr.pos.XY(), plActor->spr.Angles.Yaw, va, plActor->sector()->floorstat & CSTAT_SECTOR_SLOPE, plActor->sector(), scaleAdjust); } //--------------------------------------------------------------------------- @@ -1726,7 +1726,7 @@ void ProcessInput(PLAYER* pPlayer) if (SyncInput()) { - pPlayer->horizon.applyinput(pInput->horz, &pInput->actions); + pPlayer->horizon.applyPitch(pInput->horz, &pInput->actions); doslopetilting(pPlayer); } diff --git a/source/games/duke/src/inlines.h b/source/games/duke/src/inlines.h index fe2837022..1e3f30875 100644 --- a/source/games/duke/src/inlines.h +++ b/source/games/duke/src/inlines.h @@ -211,7 +211,7 @@ inline bool playrunning() inline void doslopetilting(player_struct* p, double const scaleAdjust = 1) { bool const canslopetilt = p->on_ground && p->insector() && p->cursector->lotag != ST_2_UNDERWATER && (p->cursector->floorstat & CSTAT_SECTOR_SLOPE); - p->horizon.calcviewpitch(p->GetActor()->spr.pos.XY(), p->angle.ang, p->aim_mode == 0, canslopetilt, p->cursector, scaleAdjust); + p->horizon.doViewPitch(p->GetActor()->spr.pos.XY(), p->angle.ang, p->aim_mode == 0, canslopetilt, p->cursector, scaleAdjust); } //--------------------------------------------------------------------------- diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index b47da06a0..9e13d0b8c 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -838,7 +838,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju doslopetilting(p, scaleAdjust); p->angle.applyinput(p->adjustavel(input.avel), &p->sync.actions, scaleAdjust); p->apply_seasick(scaleAdjust); - p->horizon.applyinput(input.horz, &p->sync.actions, scaleAdjust); + p->horizon.applyPitch(input.horz, &p->sync.actions, scaleAdjust); } p->angle.processhelpers(scaleAdjust); diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 45a85f660..d1f9dc4bc 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -3137,7 +3137,7 @@ HORIZONLY: if (SyncInput()) { - p->horizon.applyinput(GetPlayerHorizon(snum), &actions); + p->horizon.applyPitch(GetPlayerHorizon(snum), &actions); } p->checkhardlanding(); diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index a1526245e..4a6e9a95b 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -3895,7 +3895,7 @@ HORIZONLY: if (SyncInput()) { - p->horizon.applyinput(GetPlayerHorizon(snum), &actions); + p->horizon.applyPitch(GetPlayerHorizon(snum), &actions); } p->checkhardlanding(); diff --git a/source/games/exhumed/src/input.cpp b/source/games/exhumed/src/input.cpp index 9e6078c70..4f7152fd9 100644 --- a/source/games/exhumed/src/input.cpp +++ b/source/games/exhumed/src/input.cpp @@ -87,7 +87,7 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju if (!nFreeze) { pPlayer->angle.applyinput(input.avel, &sPlayerInput[nLocalPlayer].actions, scaleAdjust); - pPlayer->horizon.applyinput(input.horz, &sPlayerInput[nLocalPlayer].actions, scaleAdjust); + pPlayer->horizon.applyPitch(input.horz, &sPlayerInput[nLocalPlayer].actions, scaleAdjust); if (input.horz) { diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 85a41c94d..1d5962880 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -2475,7 +2475,7 @@ sectdone: if (SyncInput()) { - pPlayer->horizon.applyinput(sPlayerInput[nPlayer].pan, &sPlayerInput[nLocalPlayer].actions); + pPlayer->horizon.applyPitch(sPlayerInput[nPlayer].pan, &sPlayerInput[nLocalPlayer].actions); } if (actions & (SB_AIM_UP | SB_AIM_DOWN) || sPlayerInput[nPlayer].pan) diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 9b591b39e..6932475bb 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1677,8 +1677,8 @@ void SlipSlope(PLAYER* pp) void DoPlayerHorizon(PLAYER* pp, float const horz, double const scaleAdjust) { bool const canslopetilt = !(pp->Flags & (PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING)) && pp->cursector && (pp->cursector->floorstat & CSTAT_SECTOR_SLOPE); - pp->horizon.calcviewpitch(pp->actor->spr.pos.XY(), pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursector, scaleAdjust, (pp->Flags & PF_CLIMBING)); - pp->horizon.applyinput(horz, &pp->input.actions, scaleAdjust); + pp->horizon.doViewPitch(pp->actor->spr.pos.XY(), pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursector, scaleAdjust, (pp->Flags & PF_CLIMBING)); + pp->horizon.applyPitch(horz, &pp->input.actions, scaleAdjust); } //---------------------------------------------------------------------------