mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 04:21:47 +00:00
Watertight fix I was avoiding because it's definitely slower to check ranges at runtime, but papersprites are used intermittently enough that I don't think it's a super big deal.
This commit is contained in:
parent
200f1cb01e
commit
00931cbb35
1 changed files with 11 additions and 7 deletions
|
|
@ -917,6 +917,16 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
||||||
|
|
||||||
for (dc_x = vis->x1; dc_x <= vis->x2; dc_x++, frac += vis->xiscale)
|
for (dc_x = vis->x1; dc_x <= vis->x2; dc_x++, frac += vis->xiscale)
|
||||||
{
|
{
|
||||||
|
if (vis->scalestep) // currently papersprites only
|
||||||
|
{
|
||||||
|
#ifndef RANGECHECK
|
||||||
|
if ((frac>>FRACBITS) >= SHORT(patch->width)) // slower but kills intermittent crashes...
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
sprtopscreen = (centeryfrac - FixedMul(dc_texturemid, spryscale));
|
||||||
|
dc_iscale = (0xffffffffu / (unsigned)spryscale);
|
||||||
|
spryscale += vis->scalestep;
|
||||||
|
}
|
||||||
#ifdef RANGECHECK
|
#ifdef RANGECHECK
|
||||||
texturecolumn = frac>>FRACBITS;
|
texturecolumn = frac>>FRACBITS;
|
||||||
|
|
||||||
|
|
@ -926,16 +936,10 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
||||||
#else
|
#else
|
||||||
column = (column_t *)((UINT8 *)patch + LONG(patch->columnofs[frac>>FRACBITS]));
|
column = (column_t *)((UINT8 *)patch + LONG(patch->columnofs[frac>>FRACBITS]));
|
||||||
#endif
|
#endif
|
||||||
if (vis->scalestep)
|
|
||||||
{
|
|
||||||
sprtopscreen = (centeryfrac - FixedMul(dc_texturemid, spryscale));
|
|
||||||
dc_iscale = (0xffffffffu / (unsigned)spryscale);
|
|
||||||
}
|
|
||||||
if (vis->vflip)
|
if (vis->vflip)
|
||||||
R_DrawFlippedMaskedColumn(column, patch->height);
|
R_DrawFlippedMaskedColumn(column, patch->height);
|
||||||
else
|
else
|
||||||
R_DrawMaskedColumn(column);
|
R_DrawMaskedColumn(column);
|
||||||
spryscale += vis->scalestep;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
colfunc = basecolfunc;
|
colfunc = basecolfunc;
|
||||||
|
|
@ -1257,7 +1261,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
||||||
|
|
||||||
offset2 = FixedMul(spritecachedinfo[lump].width, this_scale);
|
offset2 = FixedMul(spritecachedinfo[lump].width, this_scale);
|
||||||
tx += FixedMul(offset2, ang_scale);
|
tx += FixedMul(offset2, ang_scale);
|
||||||
x2 = ((centerxfrac + FixedMul (tx,xscale)) >> FRACBITS) - (papersprite ? 2 : 1);
|
x2 = ((centerxfrac + FixedMul (tx,xscale)) >> FRACBITS) - 1;
|
||||||
|
|
||||||
// off the left side
|
// off the left side
|
||||||
if (x2 < 0)
|
if (x2 < 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue