OpenTTD Source: src/ship_gui.cpp File Reference

OpenTTD Source 15.0-beta1

Functions
ship_gui.cpp File Reference

GUI for ships. More...

`#include "stdafx.h"`
`#include "vehicle_base.h"`
`#include "window_gui.h"`
`#include "gfx_func.h"`
`#include "vehicle_gui.h"`
`#include "strings_func.h"`
`#include "vehicle_func.h"`
`#include "spritecache.h"`
`#include "zoom_func.h"`
`#include "table/strings.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Functions
void | DrawShipImage (const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type)
| Draws an image of a ship.
void | DrawShipDetails (const Vehicle *v, const Rect &r)
| Draw the details for the given vehicle at the given position.

## Detailed Description

GUI for ships.

Definition in file ship_gui.cpp.

## Function Documentation

## ◆ DrawShipDetails()

void DrawShipDetails | ( | const Vehicle * | v,
|  | const Rect & | r
| ) |  |

Draw the details for the given vehicle at the given position.

Parameters

  v | current vehicle
  r | the Rect to draw within

Definition at line 63 of file ship_gui.cpp.

References Vehicle::build_year, Vehicle::cargo, Vehicle::cargo_cap, Vehicle::cargo_type, DrawString(), Vehicle::engine_type, FS_NORMAL, GetCargoSubtypeText(), GetCharacterHeight(), VehicleCargoList::GetFeederShare(), VehicleCargoList::GetFirstStation(), PackEngineNameDParam(), WidgetDimensions::scaled, SetDParam(), VehicleCargoList::StoredCount(), Vehicle::value, VehicleDetails, and WidgetDimensions::vsep_normal.

Referenced by VehicleDetailsWindow::DrawVehicleDetails().

## ◆ DrawShipImage()

void DrawShipImage | ( | const Vehicle * | v,
|  | const Rect & | r,
|  | VehicleID | selection,
|  | EngineImageType | image_type
| ) |  |

Draws an image of a ship.

Parameters

  v | Front vehicle
  r | Rect to draw at
  selection | Selected vehicle to draw a frame around

Definition at line 30 of file ship_gui.cpp.

References _current_text_dir, WidgetDimensions::bevel, Vehicle::cargo_cap, Vehicle::cargo_type, CenterBounds(), DIR_E, DIR_W, VehicleSpriteSeq::Draw(), DrawCargoIconOverlay(), DrawFrameRect(), Rect::Expand(), FR_BORDERONLY, VehicleSpriteSeq::GetBounds(), Vehicle::GetImage(), GetVehiclePalette(), Rect::Height(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, WidgetDimensions::scaled, ScaleSpriteTrad(), TD_RTL, UnScaleGUI(), and Rect::Width().

Referenced by DrawVehicleImage(), and DepotWindow::DrawVehicleInDepot().