Don't scale objects if they already fit into the slot.
This commit is contained in:
parent
fca87f6575
commit
8bbdeb9407
|
@ -212,14 +212,18 @@ static void drawInventory(void)
|
|||
if (world.bob->items[i] != NULL)
|
||||
{
|
||||
r = getCurrentFrame(world.bob->items[i]->sprite[0]);
|
||||
|
||||
w = r->w;
|
||||
h = r->h;
|
||||
|
||||
d = 40;
|
||||
d /= (w > h) ? w : h;
|
||||
if (w > 40 || h > 40)
|
||||
{
|
||||
d = 40;
|
||||
d /= (w > h) ? w : h;
|
||||
|
||||
w *= d;
|
||||
h *= d;
|
||||
w *= d;
|
||||
h *= d;
|
||||
}
|
||||
|
||||
blitRectScaled(atlasTexture->texture, x + mid, y + mid, w, h, r, 1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue