mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-20 19:02:34 +00:00
Add reset interpolation state functions
This commit is contained in:
parent
4ee6027180
commit
f2a881f385
2 changed files with 31 additions and 20 deletions
49
src/p_mobj.c
49
src/p_mobj.c
|
@ -892,6 +892,30 @@ void P_EmeraldManager(void)
|
|||
emeraldspawndelay = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// P_ResetInterpolationState
|
||||
//
|
||||
// Reset the rendering interpolation state of the mobj.
|
||||
//
|
||||
void P_ResetInterpolationState(mobj_t *mobj)
|
||||
{
|
||||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
}
|
||||
|
||||
//
|
||||
// P_ResetPrecipitationInterpolationState
|
||||
//
|
||||
// Reset the rendering interpolation state of the precipmobj.
|
||||
//
|
||||
void P_ResetPrecipitationInterpolationState(precipmobj_t *mobj)
|
||||
{
|
||||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
}
|
||||
|
||||
//
|
||||
// P_ExplodeMissile
|
||||
//
|
||||
|
@ -4026,10 +4050,7 @@ void P_NullPrecipThinker(precipmobj_t *mobj)
|
|||
|
||||
void P_SnowThinker(precipmobj_t *mobj)
|
||||
{
|
||||
// reset old state (for interpolation)
|
||||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
P_ResetPrecipitationInterpolationState(mobj);
|
||||
|
||||
P_CycleStateAnimation((mobj_t *)mobj);
|
||||
|
||||
|
@ -4040,10 +4061,7 @@ void P_SnowThinker(precipmobj_t *mobj)
|
|||
|
||||
void P_RainThinker(precipmobj_t *mobj)
|
||||
{
|
||||
// reset old state (for interpolation)
|
||||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
P_ResetPrecipitationInterpolationState(mobj);
|
||||
|
||||
P_CycleStateAnimation((mobj_t *)mobj);
|
||||
|
||||
|
@ -10041,10 +10059,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
I_Assert(mobj != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mobj));
|
||||
|
||||
// Set old position (for interpolation)
|
||||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
P_ResetInterpolationState(mobj);
|
||||
|
||||
if (mobj->flags & MF_NOTHINK)
|
||||
return;
|
||||
|
@ -10911,10 +10926,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
|||
if (CheckForReverseGravity && !(mobj->flags & MF_NOBLOCKMAP))
|
||||
P_CheckGravity(mobj, false);
|
||||
|
||||
// set old state too (for interpolation)
|
||||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
P_ResetInterpolationState(mobj);
|
||||
|
||||
return mobj;
|
||||
}
|
||||
|
@ -10963,10 +10975,7 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype
|
|||
|| mobj->subsector->sector->floorpic == skyflatnum)
|
||||
mobj->precipflags |= PCF_PIT;
|
||||
|
||||
// set initial old positions (for interpolation)
|
||||
mobj->old_x = mobj->x;
|
||||
mobj->old_y = mobj->y;
|
||||
mobj->old_z = mobj->z;
|
||||
P_ResetPrecipitationInterpolationState(mobj);
|
||||
|
||||
return mobj;
|
||||
}
|
||||
|
|
|
@ -501,6 +501,8 @@ void P_RingZMovement(mobj_t *mo);
|
|||
boolean P_SceneryZMovement(mobj_t *mo);
|
||||
void P_PlayerZMovement(mobj_t *mo);
|
||||
void P_EmeraldManager(void);
|
||||
void P_ResetInterpolationState(mobj_t *mobj);
|
||||
void P_ResetPrecipitationInterpolationState(precipmobj_t *mobj);
|
||||
|
||||
extern INT32 modulothing;
|
||||
|
||||
|
|
Loading…
Reference in a new issue