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)
|
if (world.bob->items[i] != NULL)
|
||||||
{
|
{
|
||||||
r = getCurrentFrame(world.bob->items[i]->sprite[0]);
|
r = getCurrentFrame(world.bob->items[i]->sprite[0]);
|
||||||
|
|
||||||
w = r->w;
|
w = r->w;
|
||||||
h = r->h;
|
h = r->h;
|
||||||
|
|
||||||
d = 40;
|
if (w > 40 || h > 40)
|
||||||
d /= (w > h) ? w : h;
|
{
|
||||||
|
d = 40;
|
||||||
w *= d;
|
d /= (w > h) ? w : h;
|
||||||
h *= d;
|
|
||||||
|
w *= d;
|
||||||
|
h *= d;
|
||||||
|
}
|
||||||
|
|
||||||
blitRectScaled(atlasTexture->texture, x + mid, y + mid, w, h, r, 1);
|
blitRectScaled(atlasTexture->texture, x + mid, y + mid, w, h, r, 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue