Maybe this is a better way to work around the DrawMasked crash...

This commit is contained in:
fickleheart 2019-02-19 19:26:32 -06:00
parent 7a80195ed7
commit 766ceabf91
1 changed files with 8 additions and 1 deletions

View File

@ -651,7 +651,7 @@ void R_DrawMaskedColumn(column_t *column)
basetexturemid = dc_texturemid;
for (; column && column->topdelta != 0xff ;)
for (; column->topdelta != 0xff ;)
{
// calculate unclipped screen coordinates
// for post
@ -925,6 +925,13 @@ static void R_DrawVisSprite(vissprite_t *vis)
if (vis->x2 >= vid.width)
vis->x2 = vid.width-1;
#if 1
// Something is occasionally setting 1px-wide sprites whose frac is exactly the width of the sprite, causing crashes due to
// accessing invalid column info. Until the cause is found, let's try to correct those manually...
while (frac + vis->xiscale*(vis->x2-vis->x1) > SHORT(patch->width)<<FRACBITS && vis->x2 >= vis->x1)
vis->x2--;
#endif
for (dc_x = vis->x1; dc_x <= vis->x2; dc_x++, frac += vis->xiscale)
{
if (vis->scalestep) // currently papersprites only