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