|
OpenTTD Source
14.0-beta3
|
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.
void SetRoadTypes(Tile t, RoadType road_rt, RoadType tram_rt)
Set the present road types of a tile.
Axis
Allow incrementing of DiagDirDiff variables.
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.
debug_inline uint16_t & m8()
General purpose.
debug_inline byte & m6()
General purpose.
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.
@ TRANSPORT_WATER
Transport over water.
debug_inline byte & m5()
General purpose.
Owner
Enum for all companies/owners.
debug_inline byte & m4()
General purpose.
@ INVALID_ROADTYPE
flag for invalid roadtype
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.
debug_inline byte & m7()
Primarily used for newgrf support.
@ TRANSPORT_RAIL
Transport by train.
RailType
Enumeration for all possible railtypes.
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.
TransportType
Available types of transport.
bool IsBridgeTile(Tile t)
checks if there is a bridge on this tile
TileIndex GetNorthernBridgeEnd(TileIndex t)
Finds the northern end of a bridge starting at a middle tile.
@ MP_TUNNELBRIDGE
Tunnel entry/exit and bridge heads.
DiagDirection
Enumeration for diagonal directions.
uint BridgeType
Bridge spec number.
void SetTileOwner(Tile tile, Owner owner)
Sets the owner of a tile.
TileIndex GetSouthernBridgeEnd(TileIndex t)
Finds the southern end of a bridge starting at a middle tile.
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.
RoadType
The different roadtypes we support.
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_LVL_BASE.
@ TRANSPORT_ROAD
Transport by road vehicle.
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 byte & m3()
General purpose.
TileIndex GetOtherBridgeEnd(TileIndex t)
Starting at one bridge end finds the other bridge end.
@ OWNER_TOWN
A town owns the tile, or a town is expanding.
BridgeType GetBridgeType(Tile t)
Determines the type of bridge on a tile.
debug_inline byte & type()
The type (bits 4..7), bridges (2..3), rainforest/desert (0..1)
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.