OpenTTD Source
20240915-master-g3784a3d3d6
|
Go to the documentation of this file.
47 return GB(t.
type(), 2, 2) != 0;
59 return GB(t.
m6(), 2, 4);
136 t.
m5() = 1 << 7 | tt << 2 | d;
137 SB(t.
m6(), 2, 4, bridgetype);
constexpr T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
debug_inline uint8_t & m5()
General purpose.
void SetRoadTypes(Tile t, RoadType road_rt, RoadType tram_rt)
Set the present road types of a tile.
debug_inline uint8_t & m3()
General purpose.
@ TRANSPORT_WATER
Transport over water.
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.
RailType
Enumeration for all possible railtypes.
debug_inline uint16_t & m8()
General purpose.
DiagDirection
Enumeration for diagonal directions.
Wrapper class to abstract away the way the tiles are stored.
void ClearBridgeMiddle(Tile t)
Removes bridges from the given, that is bridges along the X and Y axis.
void MakeBridgeRamp(Tile t, Owner o, BridgeType bridgetype, DiagDirection d, TransportType tt)
Generic part to make a bridge ramp for both roads and rails.
debug_inline uint8_t & m4()
General purpose.
debug_inline uint8_t & m7()
Primarily used for newgrf support.
@ TRANSPORT_ROAD
Transport by road vehicle.
void MakeRailBridgeRamp(Tile t, Owner o, BridgeType bridgetype, DiagDirection d, RailType rt)
Make a bridge ramp for rails.
void SetBridgeMiddle(Tile t, Axis a)
Set that there is a bridge over the given axis.
TransportType
Available types of transport.
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
bool IsBridge(Tile t)
Checks if this is a bridge, instead of a tunnel.
int GetBridgeHeight(TileIndex tile)
Get the height ('z') of a bridge.
bool IsBridgeTile(Tile t)
checks if there is a bridge on this tile
RoadType
The different roadtypes we support.
TileIndex GetNorthernBridgeEnd(TileIndex t)
Finds the northern end of a bridge starting at a middle tile.
@ MP_TUNNELBRIDGE
Tunnel entry/exit and bridge heads.
@ INVALID_ROADTYPE
flag for invalid roadtype
debug_inline uint8_t & m6()
General purpose.
uint BridgeType
Bridge spec number.
void SetTileOwner(Tile tile, Owner owner)
Sets the owner of a tile.
@ OWNER_TOWN
A town owns the tile, or a town is expanding.
TileIndex GetSouthernBridgeEnd(TileIndex t)
Finds the southern end of a bridge starting at a middle tile.
Axis
Allow incrementing of DiagDirDiff variables.
@ TRANSPORT_RAIL
Transport by train.
void SetDockingTile(Tile t, bool b)
Set the docking tile state of a tile.
void SetRailType(Tile t, RailType r)
Sets the rail type of the given tile.
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
bool IsBridgeAbove(Tile t)
checks if a bridge is set above the ground of this tile
void SetRoadOwner(Tile t, RoadTramType rtt, Owner o)
Set the owner of a specific road type.
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_BASE.
void MakeRoadBridgeRamp(Tile t, Owner o, Owner owner_road, Owner owner_tram, BridgeType bridgetype, DiagDirection d, RoadType road_rt, RoadType tram_rt)
Make a bridge ramp for roads.
constexpr T SB(T &x, const uint8_t s, const uint8_t n, const U d)
Set n bits in x starting at bit s to d.
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
void MakeAqueductBridgeRamp(Tile t, Owner o, DiagDirection d)
Make a bridge ramp for aqueducts.
int GetBridgePixelHeight(TileIndex tile)
Get the height ('z') of a bridge in pixels.
Axis GetBridgeAxis(Tile t)
Get the axis of the bridge that goes over the tile.
constexpr T ClrBit(T &x, const uint8_t y)
Clears a bit in a variable.
void ClearSingleBridgeMiddle(Tile t, Axis a)
Remove the bridge over the given axis.
debug_inline uint8_t & type()
The type (bits 4..7), bridges (2..3), rainforest/desert (0..1)
TileIndex GetOtherBridgeEnd(TileIndex t)
Starting at one bridge end finds the other bridge end.
BridgeType GetBridgeType(Tile t)
Determines the type of bridge on a tile.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.