OpenTTD Source: src/waypoint_func.h File Reference

OpenTTD Source 14.0-beta1

Functions
waypoint_func.h File Reference
`#include "rail_type.h"`
`#include "command_type.h"`
`#include "station_type.h"`

Go to the source code of this file.

## Functions
CommandCost | RemoveBuoy (TileIndex tile, DoCommandFlag flags)
| Remove a buoy. More...
Axis | GetAxisForNewWaypoint (TileIndex tile)
| Get the axis for a new waypoint. More...
void | ShowWaypointWindow (const Waypoint *wp)
| Show the window for the given waypoint. More...
void | DrawWaypointSprite (int x, int y, int stat_id, RailType railtype)
| Draw a waypoint. More...

## Detailed Description

Functions related to waypoints.

Definition in file waypoint_func.h.

## Function Documentation

## ◆ DrawWaypointSprite()

void DrawWaypointSprite | ( | int | x,
|  | int | y,
|  | int | stat_id,
|  | RailType | railtype
| ) |  |

Draw a waypoint.

Parameters

  x | coordinate
  y | coordinate
  stat_id | station id
  railtype | RailType to use for

Definition at line 27 of file waypoint.cpp.

## ◆ GetAxisForNewWaypoint()

Axis GetAxisForNewWaypoint | ( | TileIndex | tile | ) |

Get the axis for a new waypoint.

This means that if it is a valid tile to build a waypoint on it returns a valid Axis, otherwise an invalid one.

Parameters

  tile | the tile to look at.

Returns
  the axis for the to-be-build waypoint.

Definition at line 99 of file waypoint_cmd.cpp.

References AXIS_X, AXIS_Y, GetRailStationAxis(), GetRailTileType(), GetTrackBits(), INVALID_AXIS, IsRailWaypointTile(), IsTileType(), MP_RAILWAY, RAIL_TILE_NORMAL, TRACK_BIT_X, and TRACK_BIT_Y.

Referenced by PlaceRail_Waypoint().

## ◆ RemoveBuoy()

CommandCost RemoveBuoy | ( | TileIndex | tile,
|  | DoCommandFlag | flags
| ) |  |

Remove a buoy.

Parameters

  tile | TileIndex been queried
  flags | operation to perform

Precondition
  IsBuoyTile(tile)

Returns
  cost or failure of operation

Definition at line 367 of file waypoint_cmd.cpp.

References _current_company, DC_BANKRUPT, DC_EXEC, EnsureNoVehicleOnGround(), FACIL_DOCK, BaseStation::facilities, CommandCost::Failed(), SpecializedStation< Waypoint, true >::GetByTile(), HasStationInUse(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, INVALID_STRING_ID, InvalidateWindowData(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), return_cmd_error, and WC_WAYPOINT_VIEW.

## ◆ ShowWaypointWindow()

void ShowWaypointWindow | ( | const Waypoint * | wp | ) |

Show the window for the given waypoint.

Parameters

  wp | The waypoint to show the window for.

Definition at line 197 of file waypoint_gui.cpp.

References _waypoint_view_desc, and Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index.