# roadveh_gui.cpp File Reference

GUI for road vehicles. More...

`#include "stdafx.h"`
`#include "roadveh.h"`
`#include "window_gui.h"`
`#include "gfx_func.h"`
`#include "vehicle_gui.h"`
`#include "strings_func.h"`
`#include "vehicle_func.h"`
`#include "string_func.h"`
`#include "table/sprites.h"`
`#include "table/strings.h"`

Go to the source code of this file.

## Functions
void | DrawRoadVehDetails (const Vehicle *v, int left, int right, int y)
| Draw the details for the given vehicle at the given position.
void | DrawRoadVehImage (const Vehicle *v, int left, int right, int y, VehicleID selection)
| Draws an image of a road vehicle chain.

## Detailed Description

GUI for road vehicles.

Definition in file roadveh_gui.cpp.

## Function Documentation

void DrawRoadVehDetails | ( | const Vehicle * | v,
|  | int | left,
|  | int | right,
|  | int | y |
| ) |  |  |

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

Parameters:

  | v | current vehicle
  | left | The left most coordinate to draw
  | right | The right most coordinate to draw
  | y | The y coordinate

Definition at line 32 of file roadveh_gui.cpp.

References DrawString(), FONT_HEIGHT_NORMAL, SpecializedVehicle< RoadVehicle, VEH_ROAD >::From(), GetCargoSubtypeText(), RoadVehicle::HasArticulatedPart(), lastof, NUM_CARGO, SA_LEFT, SA_STRIP, SetDParam(), and strecat().

Referenced by VehicleDetailsWindow::DrawVehicleDetails().

void DrawRoadVehImage | ( | const Vehicle * | v,
|  | int | left,
|  | int | right,
|  | int | y,
|  | VehicleID | selection |
| ) |  |  |

Draws an image of a road vehicle chain.

Parameters:

  | v | Front vehicle
  | left | The minimum horizontal position
  | right | The maximum horizontal position
  | y | Vertical position to draw at
  | selection | Selected vehicle to draw a frame around

Definition at line 132 of file roadveh_gui.cpp.

References _dynlang, DIR_E, DIR_W, DrawFrameRect(), DrawSprite(), FR_BORDERONLY, SpecializedVehicle< RoadVehicle, VEH_ROAD >::From(), RoadVehicle::GetDisplayImageWidth(), RoadVehicle::GetImage(), GetVehiclePalette(), SpecializedVehicle< T, Type >::Next(), TD_RTL, DynamicLanguages::text_dir, Point::x, and Point::y.

Referenced by DrawVehicleImage().