mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-19 15:40:58 +00:00
- Rename PlayerHorizon
prototypes in preparation for replacement work.
This commit is contained in:
parent
b38f9a8779
commit
d810afa2e9
11 changed files with 15 additions and 15 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -3137,7 +3137,7 @@ HORIZONLY:
|
|||
|
||||
if (SyncInput())
|
||||
{
|
||||
p->horizon.applyinput(GetPlayerHorizon(snum), &actions);
|
||||
p->horizon.applyPitch(GetPlayerHorizon(snum), &actions);
|
||||
}
|
||||
|
||||
p->checkhardlanding();
|
||||
|
|
|
@ -3895,7 +3895,7 @@ HORIZONLY:
|
|||
|
||||
if (SyncInput())
|
||||
{
|
||||
p->horizon.applyinput(GetPlayerHorizon(snum), &actions);
|
||||
p->horizon.applyPitch(GetPlayerHorizon(snum), &actions);
|
||||
}
|
||||
|
||||
p->checkhardlanding();
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue