Skip to content

Commit

Permalink
- Rename PlayerHorizon prototypes in preparation for replacement work.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr4077au committed Nov 26, 2022
1 parent 8b65395 commit ec320bd
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions source/core/gameinput.cpp
Expand Up @@ -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())
Expand Down Expand Up @@ -275,7 +275,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)
{
Expand Down
4 changes: 2 additions & 2 deletions source/core/gameinput.h
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion source/games/blood/src/controls.cpp
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions source/games/blood/src/player.cpp
Expand Up @@ -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);
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/inlines.h
Expand Up @@ -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);
}

//---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/input.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/player_d.cpp
Expand Up @@ -3131,7 +3131,7 @@ void processinput_d(int snum)

if (SyncInput())
{
p->horizon.applyinput(GetPlayerHorizon(snum), &actions);
p->horizon.applyPitch(GetPlayerHorizon(snum), &actions);
}

p->checkhardlanding();
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/player_r.cpp
Expand Up @@ -3895,7 +3895,7 @@ void processinput_r(int snum)

if (SyncInput())
{
p->horizon.applyinput(GetPlayerHorizon(snum), &actions);
p->horizon.applyPitch(GetPlayerHorizon(snum), &actions);
}

p->checkhardlanding();
Expand Down
2 changes: 1 addition & 1 deletion source/games/exhumed/src/input.cpp
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion source/games/exhumed/src/player.cpp
Expand Up @@ -2475,7 +2475,7 @@ void AIPlayer::Tick(RunListEvent* ev)

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)
Expand Down
4 changes: 2 additions & 2 deletions source/games/sw/src/player.cpp
Expand Up @@ -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);
}

//---------------------------------------------------------------------------
Expand Down

0 comments on commit ec320bd

Please sign in to comment.