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