Merge branch 'ripple-sprite-scale-fixes' into 'next'

Fix sprite scale column iteration crash

See merge request STJr/SRB2!2130
This commit is contained in:
sphere 2023-09-05 17:23:09 +00:00
commit 04c9bb202d

View file

@ -844,6 +844,15 @@ static void R_DrawVisSprite(vissprite_t *vis)
if ((UINT64)overflow_test&0xFFFFFFFF80000000ULL) return; // ditto if ((UINT64)overflow_test&0xFFFFFFFF80000000ULL) return; // ditto
} }
// TODO This check should not be necessary. But Papersprites near to the camera will sometimes create invalid values
// for the vissprite's startfrac. This happens because they are not depth culled like other sprites.
// Someone who is more familiar with papersprites pls check and try to fix <3
if (vis->startfrac < 0 || vis->startfrac > (patch->width << FRACBITS))
{
// never draw vissprites with startfrac out of patch range
return;
}
colfunc = colfuncs[BASEDRAWFUNC]; // hack: this isn't resetting properly somewhere. colfunc = colfuncs[BASEDRAWFUNC]; // hack: this isn't resetting properly somewhere.
dc_colormap = vis->colormap; dc_colormap = vis->colormap;
dc_translation = R_GetSpriteTranslation(vis); dc_translation = R_GetSpriteTranslation(vis);