mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-04-04 17:02:24 +00:00
Interpolate mobj scale
This commit is contained in:
parent
f6c1e49b27
commit
51553e7f75
5 changed files with 10 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -59,6 +59,7 @@ typedef struct {
|
|||
fixed_t z;
|
||||
subsector_t *subsector;
|
||||
angle_t angle;
|
||||
fixed_t scale;
|
||||
} interpmobjstate_t;
|
||||
|
||||
// Level interpolators
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue