|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
128 return (_price[PR_INFRASTRUCTURE_ROAD] *
GetRoadTypeInfo(roadtype)->maintenance_multiplier * num * (1 +
IntSqrt(total_num))) >> 12;
@ ROADTYPE_END
Used for iterations.
RoadTypes AddDateIntroducedRoadTypes(RoadTypes current, TimerGameCalendar::Date date)
Add the road types that are to be introduced at the given date.
Tile information, used while rendering the tile.
Axis
Allow incrementing of DiagDirDiff variables.
DiagDirDiff
Enumeration for the difference between to DiagDirection.
uint32_t IntSqrt(uint32_t num)
Compute the integer square root.
void MarkDirtyAdjacentLevelCrossingTiles(TileIndex tile, Axis road_axis)
Find adjacent level crossing tiles in this multi-track crossing and mark them dirty.
constexpr static debug_inline uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
RoadTypes GetCompanyRoadTypes(CompanyID company, bool introduces=true)
Get the road types the given company can build.
Money RoadMaintenanceCost(RoadType roadtype, uint32_t num, uint32_t total_num)
Calculates the maintenance cost of a number of road bits.
RoadTypes GetRoadTypes(bool introduces)
Get list of road types, regardless of company availability.
Owner
Enum for all companies/owners.
uint32_t PaletteID
The number of the palette.
@ ROAD_X
Full road along the x-axis (south-west + north-east)
@ ROTF_CATENARY
Bit number for adding catenary.
bool IsInvisibilitySet(TransparencyOption to)
Check if the invisibility option bit is set and if we aren't in the game menu (there's never transpar...
@ ROAD_Y
Full road along the y-axis (north-west + south-east)
@ ROAD_ALL
Full 4-way crossing.
bool HasRoadCatenaryDrawn(RoadType roadtype)
Test if we should draw road catenary.
bool HasRoadTypeAvail(CompanyID company, RoadType roadtype)
Finds out, whether given company has a given RoadType available for construction.
@ ROAD_END
Out-of-range roadbits, used for iterations.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
bool IsStraightRoad(RoadBits r)
Check if we've got a straight road.
RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot)
Calculate rotated RoadBits.
void UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval(TileIndex tile, Axis road_axis)
Update adjacent level crossing tiles in this multi-track crossing, due to removal of a level crossing...
RoadBits DiagDirToRoadBits(DiagDirection d)
Create the road-part which belongs to the given DiagDirection.
DiagDirection
Enumeration for diagonal directions.
bool IsValidAxis(Axis d)
Checks if an integer value is a valid Axis.
bool ValParamRoadType(RoadType roadtype)
Validate functions for rail building.
const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
void UpdateCompanyRoadInfrastructure(RoadType rt, Owner o, int count)
Update road infrastructure counts for a company.
bool IsValidDiagDirection(DiagDirection d)
Checks if an integer value is a valid DiagDirection.
RoadBits ComplementRoadBits(RoadBits r)
Calculate the complement of a RoadBits value.
bool IsValidRoadBits(RoadBits r)
Whether the given roadtype is valid.
RoadType
The different roadtypes we support.
RoadBits
Enumeration for the road parts on a tile.
void UpdateLevelCrossing(TileIndex tile, bool sound=true, bool force_bar=false)
Update a level crossing to barred or open (crossing may include multiple adjacent tiles).
@ ROAD_NW
North-west part.
void DrawRoadOverlays(const TileInfo *ti, PaletteID pal, const RoadTypeInfo *road_rti, const RoadTypeInfo *tram_rit, uint road_offset, uint tram_offset, bool draw_underlay=true)
Draw road underlay and overlay sprites.
RoadBits MirrorRoadBits(RoadBits r)
Calculate the mirrored RoadBits.
RoadBits AxisToRoadBits(Axis a)
Create the road-part which belongs to the given Axis.
bool HasRoadCatenary(RoadType roadtype)
Test if a road type has catenary.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.