From 32f1dc5dd5cc387d631b406eb66d6f39d10f1ae9 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Tue, 4 Jul 2023 11:31:35 +0700 Subject: [PATCH] fix rightmost column in weapon rendering with interpolation enabled (#1125) --- src/r_things.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 7966ecea..eb81f794 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -811,10 +811,11 @@ void R_DrawPSprite (pspdef_t *psp) if (lump == oldlump && pspr_interp) { - int deltax = vis->x2 - vis->x1; + int deltax = x2 - vis->x1; vis->x1 = oldx1 + FixedMul(vis->x1 - oldx1, fractionaltic); vis->x2 = vis->x1 + deltax; - vis->x2 = vis->x2 >= viewwidth ? viewwidth - 1 : vis->x2; + if (vis->x2 >= viewwidth) + vis->x2 = viewwidth - 1; vis->texturemid = oldtexturemid + FixedMul(vis->texturemid - oldtexturemid, fractionaltic); } else