mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
c1e3c16232
3 changed files with 19 additions and 19 deletions
|
@ -823,7 +823,7 @@ public:
|
|||
}
|
||||
|
||||
// These also set CF_INTERPVIEW for players.
|
||||
void SetPitch(int p, bool interpolate);
|
||||
void SetPitch(int p, bool interpolate, bool forceclamp = false);
|
||||
void SetAngle(angle_t ang, bool interpolate);
|
||||
void SetRoll(angle_t roll, bool interpolate);
|
||||
|
||||
|
|
|
@ -3115,8 +3115,24 @@ void AActor::SetShade (int r, int g, int b)
|
|||
fillcolor = MAKEARGB(ColorMatcher.Pick (r, g, b), r, g, b);
|
||||
}
|
||||
|
||||
void AActor::SetPitch(int p, bool interpolate)
|
||||
void AActor::SetPitch(int p, bool interpolate, bool forceclamp)
|
||||
{
|
||||
if (player != NULL || forceclamp)
|
||||
{ // clamp the pitch we set
|
||||
int min, max;
|
||||
|
||||
if (player != NULL)
|
||||
{
|
||||
min = player->MinPitch;
|
||||
max = player->MaxPitch;
|
||||
}
|
||||
else
|
||||
{
|
||||
min = -ANGLE_90 + (1 << ANGLETOFINESHIFT);
|
||||
max = ANGLE_90 - (1 << ANGLETOFINESHIFT);
|
||||
}
|
||||
p = clamp<int>(p, min, max);
|
||||
}
|
||||
if (p != pitch)
|
||||
{
|
||||
pitch = p;
|
||||
|
|
|
@ -3989,23 +3989,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch)
|
|||
return;
|
||||
}
|
||||
|
||||
if (ref->player != NULL || (flags & SPF_FORCECLAMP))
|
||||
{ // clamp the pitch we set
|
||||
int min, max;
|
||||
|
||||
if (ref->player != NULL)
|
||||
{
|
||||
min = ref->player->MinPitch;
|
||||
max = ref->player->MaxPitch;
|
||||
}
|
||||
else
|
||||
{
|
||||
min = -ANGLE_90 + (1 << ANGLETOFINESHIFT);
|
||||
max = ANGLE_90 - (1 << ANGLETOFINESHIFT);
|
||||
}
|
||||
pitch = clamp<int>(pitch, min, max);
|
||||
}
|
||||
ref->SetPitch(pitch, !!(flags & SPF_INTERPOLATE));
|
||||
ref->SetPitch(pitch, !!(flags & SPF_INTERPOLATE), !!(flags & SPF_FORCECLAMP));
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
Loading…
Reference in a new issue