OpenTTD Source: src/depot_func.h File Reference

OpenTTD Source 14.0-beta1

Functions
depot_func.h File Reference
`#include "vehicle_type.h"`
`#include "slope_func.h"`

Go to the source code of this file.

## Functions
void | ShowDepotWindow (TileIndex tile, VehicleType type)
| Opens a depot window. More...
void | InitDepotWindowBlockSizes ()
| 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. More...
void | DeleteDepotHighlightOfVehicle (const Vehicle *v)
| Removes the highlight of a vehicle in a depot window. More...
bool | CanBuildDepotByTileh (DiagDirection direction, Slope tileh)
| Find out if the slope of the tile is suitable to build a depot of given direction. More...

## Detailed Description

Functions related to depots.

Definition in file depot_func.h.

## Function Documentation

## ◆ CanBuildDepotByTileh()

bool CanBuildDepotByTileh | ( | DiagDirection | direction,
|  | Slope | tileh
| ) |  |
| inline

Find out if the slope of the tile is suitable to build a depot of given direction.

Parameters

  direction | The direction in which the depot's exit points
  tileh | The slope of the tile in question

Returns
  true if the construction is possible

Definition at line 27 of file depot_func.h.

References InclinedSlope(), IsSteepSlope(), and SLOPE_FLAT.

Referenced by AutoslopeCheckForEntranceEdge(), CheckBuildableTile(), CmdBuildRoadDepot(), and CmdBuildTrainDepot().

## ◆ DeleteDepotHighlightOfVehicle()

void DeleteDepotHighlightOfVehicle | ( | const Vehicle * | v | ) |

Removes the highlight of a vehicle in a depot window.

Parameters

  *v | Vehicle to remove all highlights from

Definition at line 1161 of file depot_gui.cpp.

References _special_mouse_mode, FindWindowById(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, ResetObjectToPlace(), Vehicle::tile, WC_VEHICLE_DEPOT, and WSM_DRAGDROP.

## ◆ InitDepotWindowBlockSizes()

void InitDepotWindowBlockSizes | ( |  | ) |

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.

Note
  Calling this function once for each game is enough.

Definition at line 218 of file depot_gui.cpp.

Referenced by ReInitAllWindows().

## ◆ ShowDepotWindow()

void ShowDepotWindow | ( | TileIndex | tile,
|  | VehicleType | type
| ) |  |

Opens a depot window.

Parameters

  tile | The tile where the depot/hangar is located
  type | The type of vehicles in the depot

Definition at line 1141 of file depot_gui.cpp.

References BringWindowToFrontById(), and WC_VEHICLE_DEPOT.