Fix sprite scaling

This commit is contained in:
Miloslav Číž 2020-11-02 12:13:06 +01:00
parent 5a071cef14
commit e16b50f2e6
1 changed files with 4 additions and 1 deletions

5
game.h
View File

@ -1099,9 +1099,12 @@ void SFG_drawScaledSprite(
uint8_t minusValue,
RCL_Unit distance)
{
if ((size > SFG_MAX_SPRITE_SIZE) || (size == 0))
if (size == 0)
return;
if (size > SFG_MAX_SPRITE_SIZE)
size = SFG_MAX_SPRITE_SIZE;
uint16_t halfSize = size / 2;
int16_t topLeftX = centerX - halfSize;