From 27f1a65c605df50d8645c1dfad9fd1653f7e8ce7 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Sat, 17 Feb 2024 23:38:08 +0700 Subject: [PATCH] restore original fix for "garbage lines at the top of weapon sprites" (#1485) * Revert "fix garbage lines at the top of weapon sprites (#1377)" This reverts commit 6cccb751849b83d0f5e12b9c85f139f085d62db1. * restore original fix --- src/r_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/r_main.c b/src/r_main.c index ab70a3ac..8c45be8b 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -586,7 +586,13 @@ void R_ExecuteSetViewSize (void) // psprite scales pspritescale = FixedDiv(viewwidth_nonwide, SCREENWIDTH); // killough 11/98 - pspriteiscale = FixedDiv(SCREENWIDTH, viewwidth_nonwide) + 1; // killough 11/98 + pspriteiscale = FixedDiv(SCREENWIDTH, viewwidth_nonwide); // killough 11/98 + + // [FG] make sure that the product of the weapon sprite scale factor + // and its reciprocal is always at least FRACUNIT to + // fix garbage lines at the top of weapon sprites + while (FixedMul(pspriteiscale, pspritescale) < FRACUNIT) + pspriteiscale++; skyiscale = FixedDiv(160 << FRACBITS, focallength);