128 return (_price[PR_INFRASTRUCTURE_ROAD] *
GetRoadTypeInfo(roadtype)->maintenance_multiplier * num * (1 +
IntSqrt(total_num))) >> 12;
bool HasRoadTypeAvail(CompanyID company, RoadType roadtype)
Finds out, whether given company has a given RoadType available for construction. ...
Owner
Enum for all companies/owners.
uint32 PaletteID
The number of the palette.
Tile information, used while rendering the tile.
static RoadBits ComplementRoadBits(RoadBits r)
Calculate the complement of a RoadBits value.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
static bool HasRoadCatenaryDrawn(RoadType roadtype)
Test if we should draw road catenary.
Full road along the x-axis (south-west + north-east)
static RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot)
Calculate rotated RoadBits.
Functions related to bit mathematics.
bool ValParamRoadType(RoadType roadtype)
Validate functions for rail building.
RoadType
The different roadtypes we support.
RoadTypes GetRoadTypes(bool introduces)
Get list of road types, regardless of company availability.
Bit number for adding catenary.
Out-of-range roadbits, used for iterations.
static const RoadTypeInfo * GetRoadTypeInfo(RoadType roadtype)
Returns a pointer to the Roadtype information for a given roadtype.
static RoadBits DiagDirToRoadBits(DiagDirection d)
Create the road-part which belongs to the given DiagDirection.
void DrawRoadOverlays(const TileInfo *ti, PaletteID pal, const RoadTypeInfo *road_rti, const RoadTypeInfo *tram_rit, uint road_offset, uint tram_offset)
Draw road underlay and overlay sprites.
static Money RoadMaintenanceCost(RoadType roadtype, uint32 num, uint32 total_num)
Calculates the maintenance cost of a number of road bits.
RoadBits
Enumeration for the road parts on a tile.
static bool IsValidDiagDirection(DiagDirection d)
Checks if an integer value is a valid DiagDirection.
RoadTypes GetCompanyRoadTypes(CompanyID company, bool introduces=true)
Get the road types the given company can build.
DiagDirDiff
Enumeration for the difference between to DiagDirection.
void UpdateLevelCrossing(TileIndex tile, bool sound=true)
Sets correct crossing state.
static RoadBits MirrorRoadBits(RoadBits r)
Calculate the mirrored RoadBits.
uint32 TileIndex
The index/ID of a Tile.
Functions related to transparency.
Functions related to the economy.
static bool IsStraightRoad(RoadBits r)
Check if we've got a straight road.
static bool IsValidAxis(Axis d)
Checks if an integer value is a valid Axis.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
void UpdateCompanyRoadInfrastructure(RoadType rt, Owner o, int count)
Update road infrastructure counts for a company.
RoadTypes AddDateIntroducedRoadTypes(RoadTypes current, Date date)
Add the road types that are to be introduced at the given date.
int32 Date
The type to store our dates in.
uint32 IntSqrt(uint32 num)
Compute the integer square root.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
static bool IsValidRoadBits(RoadBits r)
Whether the given roadtype is valid.
DiagDirection
Enumeration for diagonal directions.
Full road along the y-axis (north-west + south-east)
static 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...
static bool HasRoadCatenary(RoadType roadtype)
Test if a road type has catenary.
Axis
Allow incrementing of DiagDirDiff variables.
static RoadBits AxisToRoadBits(Axis a)
Create the road-part which belongs to the given Axis.