Cache sprite sequence bounds for vehicles

This commit is contained in:
Jonathan G Rennison
2018-01-19 19:13:01 +00:00
parent 5b226adc75
commit d730cfd51d
12 changed files with 71 additions and 41 deletions

View File

@@ -38,8 +38,7 @@ void DrawShipImage(const Vehicle *v, int left, int right, int y, VehicleID selec
VehicleSpriteSeq seq;
v->GetImage(rtl ? DIR_E : DIR_W, image_type, &seq);
Rect rect;
seq.GetBounds(&rect);
Rect16 rect = seq.GetBounds();
int width = UnScaleGUI(rect.right - rect.left + 1);
int x_offs = UnScaleGUI(rect.left);