(svn r18256) -Codechange: make the vehicle details window big font aware

This commit is contained in:
rubidium
2009-11-23 16:18:01 +00:00
parent df8d95738d
commit 3ebe581b4a
2 changed files with 24 additions and 24 deletions

View File

@@ -240,6 +240,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po
Direction dir = rtl ? DIR_E : DIR_W;
const Train *u = v;
int x = rtl ? right : left;
int sprite_y_offset = 4 + (FONT_HEIGHT_NORMAL - 10) / 2;
for (;;) {
if (--vscroll_pos < 0 && vscroll_pos >= -vscroll_cap) {
int px = x;
@@ -249,7 +250,7 @@ void DrawTrainDetails(const Train *v, int left, int right, int y, int vscroll_po
Point offset;
int width = u->GetDisplayImageWidth(&offset);
SpriteID pal = (u->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(u);
DrawSprite(u->GetImage(dir), pal, px + (rtl ? -offset.x : offset.x), y + 4 + offset.y);
DrawSprite(u->GetImage(dir), pal, px + (rtl ? -offset.x : offset.x), y + sprite_y_offset + offset.y);
px += rtl ? -width : width;
u = u->Next();
} while (u != NULL && u->IsArticulatedPart() && u->cargo_cap == 0);