mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-26 06:20:16 -04:00
fix weapon bobbing interpolation at the start of the level
This commit is contained in:
parent
1d4c8b2b0d
commit
bf9a63b090
@ -777,18 +777,23 @@ void R_DrawPSprite (pspdef_t *psp)
|
|||||||
x1_saved = vis->x1;
|
x1_saved = vis->x1;
|
||||||
texturemid_saved = vis->texturemid;
|
texturemid_saved = vis->texturemid;
|
||||||
|
|
||||||
if (lump == oldlump)
|
// Do not interpolate on the first tic of the level,
|
||||||
|
// otherwise oldx1 and oldtexturemid are not reset
|
||||||
|
if (leveltime > 1)
|
||||||
{
|
{
|
||||||
int deltax = vis->x2 - vis->x1;
|
if (lump == oldlump)
|
||||||
vis->x1 = oldx1 + FixedMul(vis->x1 - oldx1, fractionaltic);
|
{
|
||||||
vis->x2 = vis->x1 + deltax;
|
int deltax = vis->x2 - vis->x1;
|
||||||
vis->texturemid = oldtexturemid + FixedMul(vis->texturemid - oldtexturemid, fractionaltic);
|
vis->x1 = oldx1 + FixedMul(vis->x1 - oldx1, fractionaltic);
|
||||||
}
|
vis->x2 = vis->x1 + deltax;
|
||||||
else
|
vis->texturemid = oldtexturemid + FixedMul(vis->texturemid - oldtexturemid, fractionaltic);
|
||||||
{
|
}
|
||||||
oldx1 = vis->x1;
|
else
|
||||||
oldtexturemid = vis->texturemid;
|
{
|
||||||
oldlump = lump;
|
oldx1 = vis->x1;
|
||||||
|
oldtexturemid = vis->texturemid;
|
||||||
|
oldlump = lump;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user