mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- Duke: Tidy up some of the pitch stuff.
* Remove some extern'd CVARs that didn't need externing. * Change `player_struct::centeringView()` bool into proper method to handle the operation. * Operation now properly unsets `SB_CENTERVIEW` if conditions aren't met instead of relying on implied behaviour from the rest of the playsim.
This commit is contained in:
parent
a5a9882d9a
commit
0da2afe3d7
4 changed files with 18 additions and 19 deletions
|
@ -43,11 +43,7 @@ EXTERN_CVAR(Bool, cl_bloodweapinterp)
|
|||
EXTERN_CVAR(Bool, cl_bloodoldweapbalance)
|
||||
EXTERN_CVAR(Bool, cl_loadingscreens)
|
||||
EXTERN_CVAR(Bool, cl_clampedpitch)
|
||||
|
||||
EXTERN_CVAR(Int, cl_dukepitchmode)
|
||||
EXTERN_CVAR(Flag, cl_dukepitchlockreturn)
|
||||
EXTERN_CVAR(Flag, cl_dukepitchnohardlanding)
|
||||
EXTERN_CVAR(Flag, cl_dukepitchnolandingcenter)
|
||||
|
||||
EXTERN_CVAR(Bool, demorec_seeds_cvar)
|
||||
EXTERN_CVAR(Bool, demoplay_diffs)
|
||||
|
|
|
@ -2730,11 +2730,7 @@ void processinput_d(int snum)
|
|||
checklook(snum,actions);
|
||||
p->Angles.doViewYaw(&p->sync);
|
||||
|
||||
if (p->centeringView())
|
||||
{
|
||||
p->sync.horz = 0;
|
||||
setForcedSyncInput(snum);
|
||||
}
|
||||
p->updatecentering(snum);
|
||||
|
||||
if (p->on_crane != nullptr)
|
||||
{
|
||||
|
|
|
@ -3318,11 +3318,7 @@ void processinput_r(int snum)
|
|||
p->Angles.doViewYaw(&p->sync);
|
||||
p->apply_seasick();
|
||||
|
||||
if (p->centeringView())
|
||||
{
|
||||
p->sync.horz = 0;
|
||||
setForcedSyncInput(snum);
|
||||
}
|
||||
p->updatecentering(snum);
|
||||
|
||||
if (p->on_crane != nullptr)
|
||||
{
|
||||
|
|
|
@ -345,12 +345,23 @@ struct player_struct
|
|||
bobpos = GetActor()->spr.pos.XY();
|
||||
}
|
||||
|
||||
bool centeringView()
|
||||
void updatecentering(const int snum)
|
||||
{
|
||||
const bool centering = sync.actions & SB_CENTERVIEW;
|
||||
const bool lockedret = cl_dukepitchmode & kDukePitchLockReturn;
|
||||
const bool rangetest = abs(GetActor()->spr.Angles.Pitch.Degrees()) > 2.2370;
|
||||
return centering && lockedret && rangetest;
|
||||
if (!(sync.actions & SB_CENTERVIEW))
|
||||
return;
|
||||
|
||||
const bool returnlock = cl_dukepitchmode & kDukePitchLockReturn;
|
||||
const bool centertest = abs(GetActor()->spr.Angles.Pitch.Degrees()) > 2.2370;
|
||||
|
||||
if ((centertest && returnlock) || !sync.horz)
|
||||
{
|
||||
setForcedSyncInput(snum);
|
||||
sync.horz = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
sync.actions &= ~SB_CENTERVIEW;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue