diff --git a/src/d_player.h b/src/d_player.h index 0111083d0..d27627744 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -383,6 +383,7 @@ typedef struct player_s // fun thing for player sprite angle_t drawangle; angle_t old_drawangle; + angle_t old_drawangle2; // player's ring count INT16 rings; diff --git a/src/p_mobj.h b/src/p_mobj.h index e4c57beec..7e3c30dcd 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -280,6 +280,7 @@ typedef struct mobj_s // Info for drawing: position. fixed_t x, y, z; fixed_t old_x, old_y, old_z; // position interpolation + fixed_t old_x2, old_y2, old_z2; // More list: links in sector (if needed) struct mobj_s *snext; @@ -288,6 +289,7 @@ typedef struct mobj_s // More drawing info: to determine current sprite. angle_t angle, pitch, roll; // orientation angle_t old_angle, old_pitch, old_roll; // orientation interpolation + angle_t old_angle2, old_pitch2, old_roll2; angle_t rollangle; spritenum_t sprite; // used to find patch_t and flip value UINT32 frame; // frame number, plus bits see p_pspr.h @@ -409,6 +411,7 @@ typedef struct precipmobj_s // Info for drawing: position. fixed_t x, y, z; fixed_t old_x, old_y, old_z; // position interpolation + fixed_t old_x2, old_y2, old_z2; // More list: links in sector (if needed) struct precipmobj_s *snext; @@ -417,6 +420,7 @@ typedef struct precipmobj_s // More drawing info: to determine current sprite. angle_t angle, pitch, roll; // orientation angle_t old_angle, old_pitch, old_roll; // orientation interpolation + angle_t old_angle2, old_pitch2, old_roll2; angle_t rollangle; spritenum_t sprite; // used to find patch_t and flip value UINT32 frame; // frame number, plus bits see p_pspr.h diff --git a/src/p_user.c b/src/p_user.c index a3e98f516..feebafa82 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2084,6 +2084,14 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj) ghost2->flags2 |= (mobj->player->followmobj->flags2 & MF2_LINKDRAW); } + // Copy interpolation data :) + ghost->old_x = mobj->old_x2; + ghost->old_y = mobj->old_y2; + ghost->old_z = mobj->old_z2; + ghost->old_angle = (mobj->player ? mobj->player->old_drawangle2 : mobj->old_angle2); + ghost->old_pitch = mobj->old_pitch2; + ghost->old_roll = mobj->old_roll2; + return ghost; } diff --git a/src/r_fps.c b/src/r_fps.c index c4f69415c..1bc92c622 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -687,6 +687,12 @@ void R_UpdateMobjInterpolators(void) // void R_ResetMobjInterpolationState(mobj_t *mobj) { + mobj->old_x2 = mobj->old_x; + mobj->old_y2 = mobj->old_y; + mobj->old_z2 = mobj->old_z; + mobj->old_angle2 = mobj->old_angle; + mobj->old_pitch2 = mobj->old_pitch; + mobj->old_roll2 = mobj->old_roll; mobj->old_x = mobj->x; mobj->old_y = mobj->y; mobj->old_z = mobj->z; @@ -696,6 +702,7 @@ void R_ResetMobjInterpolationState(mobj_t *mobj) if (mobj->player) { + mobj->player->old_drawangle2 = mobj->player->old_drawangle; mobj->player->old_drawangle = mobj->player->drawangle; } } @@ -707,6 +714,12 @@ void R_ResetMobjInterpolationState(mobj_t *mobj) // void R_ResetPrecipitationMobjInterpolationState(precipmobj_t *mobj) { + mobj->old_x2 = mobj->old_x; + mobj->old_y2 = mobj->old_y; + mobj->old_z2 = mobj->old_z; + mobj->old_angle2 = mobj->old_angle; + mobj->old_pitch2 = mobj->old_pitch; + mobj->old_roll2 = mobj->old_roll; mobj->old_x = mobj->x; mobj->old_y = mobj->y; mobj->old_z = mobj->z;