mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- Add bool lock
to PlayerHorizon::settarget()
when setting target from the ticker without having to call setters and resetters.
This commit is contained in:
parent
5a550613f3
commit
18541d1ab4
3 changed files with 3 additions and 8 deletions
|
@ -57,8 +57,6 @@ struct PlayerHorizon
|
|||
bool targetset() { return target.asq16(); }
|
||||
|
||||
// Input locking helpers.
|
||||
void lockinput() { inputdisabled = true; }
|
||||
void unlockinput() { inputdisabled = false; }
|
||||
bool movementlocked() { return targetset() || inputdisabled; }
|
||||
|
||||
// Draw code helpers.
|
||||
|
@ -92,9 +90,10 @@ struct PlayerHorizon
|
|||
}
|
||||
}
|
||||
|
||||
void settarget(fixedhoriz value)
|
||||
void settarget(fixedhoriz value, bool const lock = false)
|
||||
{
|
||||
value = q16horiz(clamp(value.asq16(), gi->playerHorizMin(), gi->playerHorizMax()));
|
||||
inputdisabled = lock;
|
||||
|
||||
if (!SyncInput())
|
||||
{
|
||||
|
|
|
@ -2234,8 +2234,7 @@ void trPlayerCtrlSetLookAngle(int value, PLAYER* pPlayer)
|
|||
adjustment = 0;
|
||||
}
|
||||
|
||||
pPlayer->horizon.settarget(buildfhoriz(100. * tan(adjustment * pi::pi() / 1024.)));
|
||||
pPlayer->horizon.lockinput();
|
||||
pPlayer->horizon.settarget(buildfhoriz(100. * tan(adjustment * pi::pi() / 1024.)), true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -1781,9 +1781,6 @@ void ProcessInput(PLAYER* pPlayer)
|
|||
doslopetilting(pPlayer);
|
||||
}
|
||||
|
||||
pPlayer->angle.unlockinput();
|
||||
pPlayer->horizon.unlockinput();
|
||||
|
||||
pPlayer->slope = -pPlayer->horizon.horiz.asq16() >> 9;
|
||||
if (pInput->actions & SB_INVPREV)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue