OpenTTD Source: src/roadveh_gui.cpp File Reference

OpenTTD Source 15.0-RC2

Functions
roadveh_gui.cpp File Reference

GUI for road vehicles. More...

`#include "stdafx.h"`
`#include "core/backup_type.hpp"`
`#include "roadveh.h"`
`#include "window_gui.h"`
`#include "strings_func.h"`
`#include "vehicle_func.h"`
`#include "string_func.h"`
`#include "zoom_func.h"`
`#include "table/strings.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Functions
void | DrawRoadVehDetails (const Vehicle *v, const Rect &r)
| Draw the details for the given vehicle at the given position.
void | DrawRoadVehImage (const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip)
| Draws an image of a road vehicle chain.

## Detailed Description

GUI for road vehicles.

Definition in file roadveh_gui.cpp.

## Function Documentation

## ◆ DrawRoadVehDetails()

void DrawRoadVehDetails | ( | 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 29 of file roadveh_gui.cpp.

References _sorted_cargo_specs, AppendStringInPlace(), Vehicle::build_year, Vehicle::cargo, Vehicle::cargo_cap, Vehicle::cargo_type, DrawString(), Vehicle::engine_type, FS_NORMAL, GetCargoSubtypeText(), GetCharacterHeight(), VehicleCargoList::GetFeederShare(), VehicleCargoList::GetFirstStation(), GetListSeparator(), GetString(), Vehicle::HasArticulatedPart(), MakeParameters(), Vehicle::Next(), PackEngineNameDParam(), WidgetDimensions::scaled, ScaleSpriteTrad(), VehicleCargoList::StoredCount(), Vehicle::value, VehicleDetails, and WidgetDimensions::vsep_normal.

Referenced by VehicleDetailsWindow::DrawVehicleDetails().

## ◆ DrawRoadVehImage()

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

Draws an image of a road vehicle chain.

Parameters

  v | Front vehicle
  r | Rect to draw at
  selection | Selected vehicle to draw a frame around
  skip | Number of pixels to skip at the front (for scrolling)

Definition at line 112 of file roadveh_gui.cpp.

References _current_text_dir, AddCargoIconOverlay(), WidgetDimensions::bevel, BorderOnly, CentreBounds(), Crashed, DIR_E, DIR_W, VehicleSpriteSeq::Draw(), DrawCargoIconOverlays(), DrawFrameRect(), Rect::Expand(), FillDrawPixelInfo(), SpecializedVehicle< T, Type >::From(), RoadVehicle::GetDisplayImageWidth(), RoadVehicle::GetImage(), GetVehiclePalette(), Rect::Height(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, SpecializedVehicle< T, Type >::Next(), PALETTE_CRASH, WidgetDimensions::scaled, ScaleSpriteTrad(), ShowCargoIconOverlay(), TD_RTL, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Rect::Translate(), Vehicle::vehstatus, Rect::Width(), Coord2D< T >::x, and Coord2D< T >::y.

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