mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-25 22:05:20 -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;
|
||||
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;
|
||||
vis->x1 = oldx1 + FixedMul(vis->x1 - oldx1, fractionaltic);
|
||||
vis->x2 = vis->x1 + deltax;
|
||||
vis->texturemid = oldtexturemid + FixedMul(vis->texturemid - oldtexturemid, fractionaltic);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldx1 = vis->x1;
|
||||
oldtexturemid = vis->texturemid;
|
||||
oldlump = lump;
|
||||
if (lump == oldlump)
|
||||
{
|
||||
int deltax = vis->x2 - vis->x1;
|
||||
vis->x1 = oldx1 + FixedMul(vis->x1 - oldx1, fractionaltic);
|
||||
vis->x2 = vis->x1 + deltax;
|
||||
vis->texturemid = oldtexturemid + FixedMul(vis->texturemid - oldtexturemid, fractionaltic);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldx1 = vis->x1;
|
||||
oldtexturemid = vis->texturemid;
|
||||
oldlump = lump;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user