mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r18128) -Codechange: rename GetVehicleListHeight to GetVehicleHeight as it has nothing to do with the height of the vehicle lists.
This commit is contained in:
parent
2e54ff1aa2
commit
ef11ce84ee
|
@ -42,7 +42,7 @@
|
|||
*/
|
||||
uint GetEngineListHeight(VehicleType type)
|
||||
{
|
||||
return max<uint>(FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM, GetVehicleListHeight(type));
|
||||
return max<uint>(FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM, GetVehicleHeight(type));
|
||||
}
|
||||
|
||||
enum BuildVehicleWidgets {
|
||||
|
|
|
@ -196,7 +196,7 @@ static void InitBlocksizeForShipAircraft(VehicleType type)
|
|||
_block_sizes[VEH_AIRCRAFT].width = max(74U, max_width);
|
||||
break;
|
||||
}
|
||||
_block_sizes[type].height = max(GetVehicleListHeight(type), max_height);
|
||||
_block_sizes[type].height = max(GetVehicleHeight(type), max_height);
|
||||
}
|
||||
|
||||
/** Set the size of the blocks in the window so we can be sure that they are big enough for the vehicle sprites in the current game.
|
||||
|
@ -204,10 +204,10 @@ static void InitBlocksizeForShipAircraft(VehicleType type)
|
|||
void InitDepotWindowBlockSizes()
|
||||
{
|
||||
_block_sizes[VEH_TRAIN].width = 1;
|
||||
_block_sizes[VEH_TRAIN].height = GetVehicleListHeight(VEH_TRAIN);
|
||||
_block_sizes[VEH_TRAIN].height = GetVehicleHeight(VEH_TRAIN);
|
||||
|
||||
_block_sizes[VEH_ROAD].width = 56;
|
||||
_block_sizes[VEH_ROAD].height = GetVehicleListHeight(VEH_ROAD);
|
||||
_block_sizes[VEH_ROAD].height = GetVehicleHeight(VEH_ROAD);
|
||||
|
||||
InitBlocksizeForShipAircraft(VEH_SHIP);
|
||||
InitBlocksizeForShipAircraft(VEH_AIRCRAFT);
|
||||
|
@ -255,7 +255,7 @@ struct DepotWindow : Window {
|
|||
void DrawVehicleInDepot(const Vehicle *v, int x, int y, int left, int right) const
|
||||
{
|
||||
bool free_wagon = false;
|
||||
int sprite_y = y + this->resize.step_height - GetVehicleListHeight(v->type);
|
||||
int sprite_y = y + this->resize.step_height - GetVehicleHeight(v->type);
|
||||
|
||||
switch (v->type) {
|
||||
case VEH_TRAIN: {
|
||||
|
|
|
@ -86,8 +86,12 @@ void ShowVehicleListWindow(CompanyID company, VehicleType vehicle_type);
|
|||
void ShowVehicleListWindow(CompanyID company, VehicleType vehicle_type, StationID station);
|
||||
void ShowVehicleListWindow(CompanyID company, VehicleType vehicle_type, TileIndex depot_tile);
|
||||
|
||||
|
||||
static inline uint GetVehicleListHeight(VehicleType type)
|
||||
/**
|
||||
* Get the height of a single vehicle in the GUIs.
|
||||
* @param type the vehicle type to look at
|
||||
* @return the height
|
||||
*/
|
||||
static inline uint GetVehicleHeight(VehicleType type)
|
||||
{
|
||||
return (type == VEH_TRAIN || type == VEH_ROAD) ? 14 : 24;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue