- Blood: reverted GetSpriteExtents to integer math.

The change in precision was enough to make the game misbehave.
This commit is contained in:
Christoph Oelckers 2023-01-21 13:55:26 +01:00
parent f92d20afc0
commit 9cc7f90410

View file

@ -88,8 +88,8 @@ void GetSpriteExtents(spritetypebase const* const pSprite, double* top, double*
if ((pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR) if ((pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR)
{ {
auto tex = TexMan.GetGameTexture(pSprite->spritetexture()); auto tex = TexMan.GetGameTexture(pSprite->spritetexture());
double height = tex->GetDisplayHeight(); int height = int(tex->GetDisplayHeight());
double center = height / 2 + tex->GetDisplayTopOffset(); int center = height / 2 + int(tex->GetDisplayTopOffset());
*top -= pSprite->scale.Y * center; *top -= pSprite->scale.Y * center;
*bottom += pSprite->scale.Y * (height - center); *bottom += pSprite->scale.Y * (height - center);
} }