Functions related to bit mathematics.
static constexpr uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
constexpr bool Test(Tvalue_type value) const
Test if the value-th bit is set.
RoadTypeFlags flags
Bit mask of road type flags.
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.
DiagDirDiff
Enumeration for the difference between to DiagDirection.
Axis
Allow incrementing of DiagDirDiff variables.
DiagDirection
Enumeration for diagonal directions.
Functions related to the economy.
@ InfrastructureRoad
Roads maintenance cost.
uint32_t PaletteID
The number of the palette.
@ 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.
RoadType
The different roadtypes we support.
@ ROADTYPE_END
Used for iterations.
Tile information, used while rendering the tile.
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > > TileIndex
The index/ID of a 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...