mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-08 16:52:01 +00:00
- Make the new scaled angle changes at frame rate opt-in behind new flag SPF_SCALEDNOLERP
.
* This will still test whether the game needs to lerp and will force `SPF_INTERPOLATE` if needed.
This commit is contained in:
parent
cf1ac82da3
commit
6629944d39
6 changed files with 57 additions and 37 deletions
|
@ -122,7 +122,8 @@ typedef enum
|
|||
CF_TOTALLYFROZEN = 1 << 12, // [RH] All players can do is press +use
|
||||
CF_PREDICTING = 1 << 13, // [RH] Player movement is being predicted
|
||||
CF_INTERPVIEW = 1 << 14, // [RH] view was changed outside of input, so interpolate one frame
|
||||
CF_INTERPVIEWANGLES = 1 << 15, // [RH] flag for interpolating view angles without interpolating the entire frame
|
||||
CF_INTERPVIEWANGLES = 1 << 15, // [MR] flag for interpolating view angles without interpolating the entire frame
|
||||
CF_SCALEDNOLERP = 1 << 15, // [MR] flag for applying angles changes in the ticrate without interpolating the frame
|
||||
CF_EXTREMELYDEAD = 1 << 22, // [RH] Reliably let the status bar know about extreme deaths.
|
||||
CF_BUDDHA2 = 1 << 24, // [MC] Absolute buddha. No voodoo can kill it either.
|
||||
CF_GODMODE2 = 1 << 25, // [MC] Absolute godmode. No voodoo can kill it either.
|
||||
|
|
|
@ -218,6 +218,7 @@ enum SPF
|
|||
{
|
||||
SPF_FORCECLAMP = 1, // players always clamp
|
||||
SPF_INTERPOLATE = 2,
|
||||
SPF_SCALEDNOLERP = 4,
|
||||
};
|
||||
|
||||
enum PCM
|
||||
|
|
|
@ -3429,18 +3429,22 @@ void AActor::SetPitch(DAngle p, int fflags)
|
|||
{
|
||||
if (player != nullptr)
|
||||
{
|
||||
if (fflags & SPF_INTERPOLATE)
|
||||
const bool mustLerp = !P_NoInterpolation(player, this);
|
||||
|
||||
if ((fflags & SPF_INTERPOLATE) || ((fflags & SPF_SCALEDNOLERP) && mustLerp))
|
||||
{
|
||||
if (P_NoInterpolation(player, this))
|
||||
{
|
||||
player->angleTargets.Pitch = deltaangle(Angles.Pitch, p);
|
||||
player->angleAppliedAmounts.Pitch = nullAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
Angles.Pitch = p;
|
||||
player->cheats |= CF_INTERPVIEW;
|
||||
}
|
||||
Angles.Pitch = p;
|
||||
player->cheats |= CF_INTERPVIEW;
|
||||
}
|
||||
else if ((fflags & SPF_SCALEDNOLERP) && !mustLerp)
|
||||
{
|
||||
player->angleTargets.Pitch = deltaangle(Angles.Pitch, p);
|
||||
player->angleAppliedAmounts.Pitch = nullAngle;
|
||||
player->cheats |= CF_SCALEDNOLERP;
|
||||
}
|
||||
else
|
||||
{
|
||||
Angles.Pitch = p;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3457,18 +3461,22 @@ void AActor::SetAngle(DAngle ang, int fflags)
|
|||
{
|
||||
if (player != nullptr)
|
||||
{
|
||||
if (fflags & SPF_INTERPOLATE)
|
||||
const bool mustLerp = !P_NoInterpolation(player, this);
|
||||
|
||||
if ((fflags & SPF_INTERPOLATE) || ((fflags & SPF_SCALEDNOLERP) && mustLerp))
|
||||
{
|
||||
if (P_NoInterpolation(player, this))
|
||||
{
|
||||
player->angleTargets.Yaw = deltaangle(Angles.Yaw, ang);
|
||||
player->angleAppliedAmounts.Yaw = nullAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
Angles.Yaw = ang;
|
||||
player->cheats |= CF_INTERPVIEW;
|
||||
}
|
||||
Angles.Yaw = ang;
|
||||
player->cheats |= CF_INTERPVIEW;
|
||||
}
|
||||
else if ((fflags & SPF_SCALEDNOLERP) && !mustLerp)
|
||||
{
|
||||
player->angleTargets.Yaw = deltaangle(Angles.Yaw, ang);
|
||||
player->angleAppliedAmounts.Yaw = nullAngle;
|
||||
player->cheats |= CF_SCALEDNOLERP;
|
||||
}
|
||||
else
|
||||
{
|
||||
Angles.Yaw = ang;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3485,18 +3493,22 @@ void AActor::SetRoll(DAngle r, int fflags)
|
|||
{
|
||||
if (player != nullptr)
|
||||
{
|
||||
if (fflags & SPF_INTERPOLATE)
|
||||
const bool mustLerp = !P_NoInterpolation(player, this);
|
||||
|
||||
if ((fflags & SPF_INTERPOLATE) || ((fflags & SPF_SCALEDNOLERP) && mustLerp))
|
||||
{
|
||||
if (P_NoInterpolation(player, this))
|
||||
{
|
||||
player->angleTargets.Roll = deltaangle(Angles.Roll, r);
|
||||
player->angleAppliedAmounts.Roll = nullAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
Angles.Roll = r;
|
||||
player->cheats |= CF_INTERPVIEW;
|
||||
}
|
||||
Angles.Roll = r;
|
||||
player->cheats |= CF_INTERPVIEW;
|
||||
}
|
||||
else if ((fflags & SPF_SCALEDNOLERP) && !mustLerp)
|
||||
{
|
||||
player->angleTargets.Roll = deltaangle(Angles.Roll, r);
|
||||
player->angleAppliedAmounts.Roll = nullAngle;
|
||||
player->cheats |= CF_SCALEDNOLERP;
|
||||
}
|
||||
else
|
||||
{
|
||||
Angles.Roll = r;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1259,6 +1259,7 @@ void P_PlayerThink (player_t *player)
|
|||
// Don't interpolate the view for more than one tic
|
||||
player->cheats &= ~CF_INTERPVIEW;
|
||||
player->cheats &= ~CF_INTERPVIEWANGLES;
|
||||
player->cheats &= ~CF_SCALEDNOLERP;
|
||||
player->mo->FloatVar("prevBob") = player->bob;
|
||||
|
||||
IFVIRTUALPTRNAME(player->mo, NAME_PlayerPawn, PlayerThink)
|
||||
|
|
|
@ -828,10 +828,13 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor
|
|||
I_Error ("You lost your body. Bad dehacked work is likely to blame.");
|
||||
}
|
||||
|
||||
// [MR] Get the input fraction, even if we don't need it this frame. Must run every frame.
|
||||
const auto scaleAdjust = I_GetInputFrac(false);
|
||||
|
||||
// [MR] Process player angle changes if permitted to do so.
|
||||
if (player && P_NoInterpolation(player, viewpoint.camera))
|
||||
if (player && (player->cheats & CF_SCALEDNOLERP) && P_NoInterpolation(player, viewpoint.camera))
|
||||
{
|
||||
R_DoActorTickerAngleChanges(player, viewpoint.camera, I_GetInputFrac(false));
|
||||
R_DoActorTickerAngleChanges(player, viewpoint.camera, scaleAdjust);
|
||||
}
|
||||
|
||||
iview = FindPastViewer (viewpoint.camera);
|
||||
|
|
|
@ -524,6 +524,7 @@ enum EAngleFlags
|
|||
{
|
||||
SPF_FORCECLAMP = 1,
|
||||
SPF_INTERPOLATE = 2,
|
||||
SPF_SCALEDNOLERP = 4,
|
||||
};
|
||||
|
||||
// flags for A_CheckLOF
|
||||
|
@ -1137,7 +1138,8 @@ enum EPlayerCheats
|
|||
CF_TOTALLYFROZEN = 1 << 12, // [RH] All players can do is press +use
|
||||
CF_PREDICTING = 1 << 13, // [RH] Player movement is being predicted
|
||||
CF_INTERPVIEW = 1 << 14, // [RH] view was changed outside of input, so interpolate one frame
|
||||
CF_INTERPVIEWANGLES = 1 << 15, // [RH] flag for interpolating view angles without interpolating the entire frame
|
||||
CF_INTERPVIEWANGLES = 1 << 15, // [MR] flag for interpolating view angles without interpolating the entire frame
|
||||
CF_SCALEDNOLERP = 1 << 15, // [MR] flag for applying angles changes in the ticrate without interpolating the frame
|
||||
|
||||
CF_EXTREMELYDEAD = 1 << 22, // [RH] Reliably let the status bar know about extreme deaths.
|
||||
|
||||
|
|
Loading…
Reference in a new issue