OpenTTD
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, int left, int right, int y, VehicleID selection, EngineImageType image_type)
 Draws an image of a ship.
void DrawShipDetails (const Vehicle *v, int left, int right, int y)
 Draw the details for the given vehicle at the given position.

Detailed Description

GUI for ships.

Definition in file ship_gui.cpp.

Function Documentation

void DrawShipDetails ( const Vehicle v,
int  left,
int  right,
int  y 
)

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

Parameters
vcurrent vehicle
leftThe left most coordinate to draw
rightThe right most coordinate to draw
yThe y coordinate

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, VehicleCargoList::FeederShare(), FONT_HEIGHT_NORMAL, GetCargoSubtypeText(), SetDParam(), VehicleCargoList::Source(), VehicleCargoList::StoredCount(), and Vehicle::value.

Referenced by VehicleDetailsWindow::DrawVehicleDetails().

void DrawShipImage ( const Vehicle v,
int  left,
int  right,
int  y,
VehicleID  selection,
EngineImageType  image_type 
)

Draws an image of a ship.

Parameters
vFront vehicle
leftThe minimum horizontal position
rightThe maximum horizontal position
yVertical position to draw at
selectionSelected vehicle to draw a frame around

Definition at line 34 of file ship_gui.cpp.

References _current_text_dir, DIR_E, DIR_W, DrawFrameRect(), DrawSprite(), FR_BORDERONLY, Vehicle::GetImage(), GetVehiclePalette(), Sprite::height, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, ScaleGUITrad(), ST_NORMAL, TD_RTL, UnScaleGUI(), Sprite::width, Sprite::x_offs, and Sprite::y_offs.

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