From b0f4bbb44b0020810c88ec2130f47097662bf406 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 2 Mar 2017 19:37:21 +0000 Subject: [PATCH] Played TD's Stormy Streets enough to know precipitation sprites didn't get an overflow test of their own (various large invisible blocks used in the level cause rain to make splashes high above the main level, high enough to make ghostly rain splash sprite artifacts appear sometimes in nearby areas) --- src/r_things.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/r_things.c b/src/r_things.c index 927217c5..331febab 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -891,12 +891,18 @@ static void R_DrawPrecipitationVisSprite(vissprite_t *vis) #endif fixed_t frac; patch_t *patch; + INT64 overflow_test; //Fab : R_InitSprites now sets a wad lump number patch = W_CacheLumpNum(vis->patch, PU_CACHE); if (!patch) return; + // Check for overflow + overflow_test = (INT64)centeryfrac - (((INT64)vis->texturemid*vis->scale)>>FRACBITS); + if (overflow_test < 0) overflow_test = -overflow_test; + if ((UINT64)overflow_test&0xFFFFFFFF80000000ULL) return; // fixed point mult would overflow + if (vis->transmap) { colfunc = fuzzcolfunc;