OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
128 return (_price[PR_INFRASTRUCTURE_ROAD] *
GetRoadTypeInfo(roadtype)->maintenance_multiplier * num * (1 +
IntSqrt(total_num))) >> 12;
RoadTypes AddDateIntroducedRoadTypes(RoadTypes current, TimerGameCalendar::Date date)
Add the road types that are to be introduced at the given date.
RoadBits
Enumeration for the road parts on a tile.
@ ROAD_Y
Full road along the y-axis (north-west + south-east)
Tile information, used while rendering the tile.
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.
Owner
Enum for all companies/owners.
@ ROAD_ALL
Full 4-way crossing.
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.
DiagDirection
Enumeration for diagonal directions.
RoadTypes GetRoadTypes(bool introduces)
Get list of road types, regardless of company availability.
uint32_t PaletteID
The number of the palette.
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.
@ ROAD_NW
North-west part.
@ 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...
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.
RoadTypes
The different roadtypes we support, but then a bitmask of them.
Roadside
The possible road side decorations.
bool IsStraightRoad(RoadBits r)
Check if we've got a straight road.
RoadBits RotateRoadBits(RoadBits r, DiagDirDiff rot)
Calculate rotated RoadBits.
RoadType
The different roadtypes we support.
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.
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.
@ ROADTYPE_END
Used for iterations.
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.
Axis
Allow incrementing of DiagDirDiff variables.
RoadBits ComplementRoadBits(RoadBits r)
Calculate the complement of a RoadBits value.
bool IsValidRoadBits(RoadBits r)
Whether the given roadtype is valid.
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).
RoadBits MirrorRoadBits(RoadBits r)
Calculate the mirrored RoadBits.
enum Roadside uint8_t 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.
@ ROAD_X
Full road along the x-axis (south-west + north-east)
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.
@ ROAD_END
Out-of-range roadbits, used for iterations.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.