- added y-off-by-one-fix for y-centered sprites.

This commit is contained in:
Christoph Oelckers 2021-03-28 12:05:29 +02:00
parent ffb956749d
commit b7bad558da

View file

@ -378,7 +378,11 @@ void HWSprite::Process(HWDrawInfo* di, spritetype* spr, sectortype* sector, int
float xoff = (tilexoff * spr->xrepeat) * (0.2f / 16.f);
float yoff = (tileyoff * spr->yrepeat) * (0.25f / 16.f);
if (spr->cstat & CSTAT_SPRITE_YCENTER) yoff -= height * 0.5f;
if (spr->cstat & CSTAT_SPRITE_YCENTER)
{
yoff -= height * 0.5;
if (ysize & 1) yoff -= spr->yrepeat * (0.125f / 16.f); // Odd yspans (taken from polymost as-is)
}
if (flags & CSTAT_SPRITE_XFLIP) xoff = -xoff;
if (flags & CSTAT_SPRITE_YFLIP) yoff = -yoff;