diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 747d3402b..013f60ed4 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5112,7 +5112,7 @@ static void HWR_ProjectSprite(mobj_t *thing) R_InterpolateMobjState(thing, FRACUNIT, &interp); } - this_scale = FIXED_TO_FLOAT(thing->scale); + this_scale = FIXED_TO_FLOAT(interp.scale); spritexscale = FIXED_TO_FLOAT(thing->spritexscale); spriteyscale = FIXED_TO_FLOAT(thing->spriteyscale); diff --git a/src/p_mobj.h b/src/p_mobj.h index 498eeb8a6..e20920181 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -377,6 +377,8 @@ typedef struct mobj_s UINT32 mobjnum; // A unique number for this mobj. Used for restoring pointers on save games. fixed_t scale; + fixed_t old_scale; // interpolation + fixed_t old_scale2; fixed_t destscale; fixed_t scalespeed; diff --git a/src/r_fps.c b/src/r_fps.c index d3a996207..a897ee555 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -266,6 +266,7 @@ void R_InterpolateMobjState(mobj_t *mobj, fixed_t frac, interpmobjstate_t *out) out->x = R_LerpFixed(mobj->old_x, mobj->x, frac); out->y = R_LerpFixed(mobj->old_y, mobj->y, frac); out->z = R_LerpFixed(mobj->old_z, mobj->z, frac); + out->scale = R_LerpFixed(mobj->old_scale, mobj->scale, frac); out->subsector = R_PointInSubsector(out->x, out->y); @@ -704,12 +705,14 @@ void R_ResetMobjInterpolationState(mobj_t *mobj) mobj->old_angle2 = mobj->old_angle; mobj->old_pitch2 = mobj->old_pitch; mobj->old_roll2 = mobj->old_roll; + mobj->old_scale2 = mobj->old_scale; mobj->old_x = mobj->x; mobj->old_y = mobj->y; mobj->old_z = mobj->z; mobj->old_angle = mobj->angle; mobj->old_pitch = mobj->pitch; mobj->old_roll = mobj->roll; + mobj->old_scale = mobj->scale; if (mobj->player) { diff --git a/src/r_fps.h b/src/r_fps.h index cf66d72f9..9a2d1d26d 100644 --- a/src/r_fps.h +++ b/src/r_fps.h @@ -59,6 +59,7 @@ typedef struct { fixed_t z; subsector_t *subsector; angle_t angle; + fixed_t scale; } interpmobjstate_t; // Level interpolators diff --git a/src/r_things.c b/src/r_things.c index fa6baddec..32ef455fe 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1481,7 +1481,7 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t gz = 0, gzt = 0; INT32 heightsec, phs; INT32 light = 0; - fixed_t this_scale = thing->scale; + fixed_t this_scale; fixed_t spritexscale, spriteyscale; // rotsprite @@ -1506,6 +1506,8 @@ static void R_ProjectSprite(mobj_t *thing) R_InterpolateMobjState(thing, FRACUNIT, &interp); } + this_scale = interp.scale; + // transform the origin point tr_x = interp.x - viewx; tr_y = interp.y - viewy;