From ffb956749d9da1f72b4f6ef2f82b9548a5c6538e Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 28 Mar 2021 20:46:50 +1100 Subject: [PATCH] - `HWSprite::Process()`: Fix `yoff` adjustment when `spr->cstat & CSTAT_SPRITE_YCENTER`. --- source/core/rendering/scene/hw_sprites.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/core/rendering/scene/hw_sprites.cpp b/source/core/rendering/scene/hw_sprites.cpp index ef68713df..7dd2c7e42 100644 --- a/source/core/rendering/scene/hw_sprites.cpp +++ b/source/core/rendering/scene/hw_sprites.cpp @@ -378,7 +378,7 @@ 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 -= width / 2; + if (spr->cstat & CSTAT_SPRITE_YCENTER) yoff -= height * 0.5f; if (flags & CSTAT_SPRITE_XFLIP) xoff = -xoff; if (flags & CSTAT_SPRITE_YFLIP) yoff = -yoff;