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