(svn r27004) -Codechange: Make GUI size apply to (sprite-font) text as well.

This commit is contained in:
peter1138
2014-10-12 20:43:25 +00:00
parent 771dcf3b7b
commit 1088ad48fc
7 changed files with 30 additions and 13 deletions

View File

@@ -438,12 +438,20 @@ static void *ReadSprite(const SpriteCache *sc, SpriteID id, SpriteType sprite_ty
return s;
}
if (sprite_type == ST_NORMAL) {
if (!ResizeSprites(sprite, sprite_avail, file_slot, sc->id)) {
if (id == SPR_IMG_QUERY) usererror("Okay... something went horribly wrong. I couldn't resize the fallback sprite. What should I do?");
return (void*)GetRawSprite(SPR_IMG_QUERY, ST_NORMAL, allocator);
}
if (!ResizeSprites(sprite, sprite_avail, file_slot, sc->id)) {
if (id == SPR_IMG_QUERY) usererror("Okay... something went horribly wrong. I couldn't resize the fallback sprite. What should I do?");
return (void*)GetRawSprite(SPR_IMG_QUERY, ST_NORMAL, allocator);
}
if (sprite->type == ST_FONT && ZOOM_LVL_GUI != ZOOM_LVL_NORMAL) {
/* Make ZOOM_LVL_GUI be ZOOM_LVL_NORMAL */
sprite[ZOOM_LVL_NORMAL] = sprite[ZOOM_LVL_GUI];
sprite->width = sprite[ZOOM_LVL_NORMAL].width;
sprite->height = sprite[ZOOM_LVL_NORMAL].height;
sprite->x_offs = sprite[ZOOM_LVL_NORMAL].x_offs;
sprite->y_offs = sprite[ZOOM_LVL_NORMAL].y_offs;
}
return BlitterFactory::GetCurrentBlitter()->Encode(sprite, allocator);
}