|
@@ -973,49 +973,49 @@ static void DrawSmallOrderList(const Veh
|
|
|
DrawString(left + 6, right - 6, y, STR_TINY_BLACK_STATION);
|
|
|
|
|
|
y += FONT_HEIGHT_SMALL;
|
|
|
if (++i == 4) break;
|
|
|
}
|
|
|
|
|
|
oid++;
|
|
|
order = order->next;
|
|
|
if (order == NULL) {
|
|
|
order = v->orders.list->GetFirstOrder();
|
|
|
oid = 0;
|
|
|
}
|
|
|
} while (oid != start);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Draws an image of a vehicle chain
|
|
|
* @param v Front vehicle
|
|
|
* @param left The minimum horizontal position
|
|
|
* @param right The maximum horizontal position
|
|
|
* @param y Vertical position to draw at
|
|
|
* @param selection Selected vehicle to draw a frame around
|
|
|
* @param skip Number of pixels to skip at the front (for scrolling)
|
|
|
*/
|
|
|
static void DrawVehicleImage(const Vehicle *v, int left, int right, int y, VehicleID selection, int skip)
|
|
|
void DrawVehicleImage(const Vehicle *v, int left, int right, int y, VehicleID selection, int skip)
|
|
|
{
|
|
|
switch (v->type) {
|
|
|
case VEH_TRAIN: DrawTrainImage(Train::From(v), left, right, y, selection, skip); break;
|
|
|
case VEH_ROAD: DrawRoadVehImage(v, left, right, y, selection); break;
|
|
|
case VEH_SHIP: DrawShipImage(v, left, right, y, selection); break;
|
|
|
case VEH_AIRCRAFT: DrawAircraftImage(v, left, right, y, selection); break;
|
|
|
default: NOT_REACHED();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Get the height of a vehicle in the vehicle list GUIs.
|
|
|
* @param type the vehicle type to look at
|
|
|
* @param divisor the resulting height must be dividable by this
|
|
|
* @return the height
|
|
|
*/
|
|
|
uint GetVehicleListHeight(VehicleType type, uint divisor)
|
|
|
{
|
|
|
/* Name + vehicle + profit */
|
|
|
uint base = GetVehicleHeight(type) + 2 * FONT_HEIGHT_SMALL;
|
|
|
/* Drawing of the 4 small orders + profit*/
|
|
|
if (type >= VEH_SHIP) base = max(base, 5U * FONT_HEIGHT_SMALL);
|
|
|
|
|
|
if (divisor == 1) return base;
|