mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
- Split insane interpolation test if statement into a function, we'll need this elsewhere later on.
This commit is contained in:
parent
9f9c1eb18a
commit
20bf9e89f5
2 changed files with 27 additions and 14 deletions
|
@ -481,4 +481,6 @@ inline bool AActor::IsNoClip2() const
|
||||||
|
|
||||||
bool P_IsPlayerTotallyFrozen(const player_t *player);
|
bool P_IsPlayerTotallyFrozen(const player_t *player);
|
||||||
|
|
||||||
|
bool P_NoInterpolation(player_t const *player, AActor const *actor);
|
||||||
|
|
||||||
#endif // __D_PLAYER_H__
|
#endif // __D_PLAYER_H__
|
||||||
|
|
|
@ -420,13 +420,35 @@ void R_Shutdown ()
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// R_InterpolateView
|
// P_NoInterpolation
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
//CVAR (Int, tf, 0, 0)
|
//CVAR (Int, tf, 0, 0)
|
||||||
EXTERN_CVAR (Bool, cl_noprediction)
|
EXTERN_CVAR (Bool, cl_noprediction)
|
||||||
|
|
||||||
|
bool P_NoInterpolation(player_t const *player, AActor const *actor)
|
||||||
|
{
|
||||||
|
return player != NULL &&
|
||||||
|
!(player->cheats & CF_INTERPVIEW) &&
|
||||||
|
player - players == consoleplayer &&
|
||||||
|
actor == player->mo &&
|
||||||
|
!demoplayback &&
|
||||||
|
!(player->cheats & (CF_TOTALLYFROZEN | CF_FROZEN)) &&
|
||||||
|
player->playerstate == PST_LIVE &&
|
||||||
|
player->mo->reactiontime == 0 &&
|
||||||
|
!NoInterpolateView &&
|
||||||
|
!paused &&
|
||||||
|
(!netgame || !cl_noprediction) &&
|
||||||
|
!LocalKeyboardTurner;
|
||||||
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// R_InterpolateView
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
void R_InterpolateView (FRenderViewpoint &viewpoint, player_t *player, double Frac, InterpolationViewer *iview)
|
void R_InterpolateView (FRenderViewpoint &viewpoint, player_t *player, double Frac, InterpolationViewer *iview)
|
||||||
{
|
{
|
||||||
if (NoInterpolateView)
|
if (NoInterpolateView)
|
||||||
|
@ -514,20 +536,9 @@ void R_InterpolateView (FRenderViewpoint &viewpoint, player_t *player, double Fr
|
||||||
viewpoint.Pos = iview->New.Pos;
|
viewpoint.Pos = iview->New.Pos;
|
||||||
viewpoint.Path[0] = viewpoint.Path[1] = iview->New.Pos;
|
viewpoint.Path[0] = viewpoint.Path[1] = iview->New.Pos;
|
||||||
}
|
}
|
||||||
if (player != NULL &&
|
if (P_NoInterpolation(player, viewpoint.camera) &&
|
||||||
!(player->cheats & CF_INTERPVIEW) &&
|
|
||||||
player - players == consoleplayer &&
|
|
||||||
viewpoint.camera == player->mo &&
|
|
||||||
!demoplayback &&
|
|
||||||
iview->New.Pos.X == viewpoint.camera->X() &&
|
iview->New.Pos.X == viewpoint.camera->X() &&
|
||||||
iview->New.Pos.Y == viewpoint.camera->Y() &&
|
iview->New.Pos.Y == viewpoint.camera->Y())
|
||||||
!(player->cheats & (CF_TOTALLYFROZEN|CF_FROZEN)) &&
|
|
||||||
player->playerstate == PST_LIVE &&
|
|
||||||
player->mo->reactiontime == 0 &&
|
|
||||||
!NoInterpolateView &&
|
|
||||||
!paused &&
|
|
||||||
(!netgame || !cl_noprediction) &&
|
|
||||||
!LocalKeyboardTurner)
|
|
||||||
{
|
{
|
||||||
viewpoint.Angles.Yaw = (nviewangle + DAngle::fromBam(LocalViewAngle)).Normalized180();
|
viewpoint.Angles.Yaw = (nviewangle + DAngle::fromBam(LocalViewAngle)).Normalized180();
|
||||||
DAngle delta = player->centering ? nullAngle : DAngle::fromBam(LocalViewPitch);
|
DAngle delta = player->centering ? nullAngle : DAngle::fromBam(LocalViewPitch);
|
||||||
|
|
Loading…
Reference in a new issue