(svn r27667) -Codechange: Add VehicleSpriteSeq::GetBounds and Draw.

This commit is contained in:
frosch
2016-10-16 14:58:38 +00:00
parent d2393b4f6c
commit c175067ed9
11 changed files with 118 additions and 73 deletions

View File

@@ -2844,8 +2844,9 @@ int GetSingleVehicleWidth(const Vehicle *v, EngineImageType image_type)
bool rtl = _current_text_dir == TD_RTL;
VehicleSpriteSeq seq;
v->GetImage(rtl ? DIR_E : DIR_W, image_type, &seq);
const Sprite *real_sprite = GetSprite(seq.sprite, ST_NORMAL);
return UnScaleGUI(real_sprite->width);
Rect rec;
seq.GetBounds(&rec);
return UnScaleGUI(rec.right - rec.left + 1);
}
}