OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
31 return (StationID)
_m[t].
m2;
408 SB(
_me[t].m6, 2, 1, b ? 1 : 0);
455 if (
IsBuoy(t))
return buoy_offset;
456 if (
IsOilRig(t))
return oilrig_offset;
472 return _m[t].
m4 != 0;
484 _m[t].
m4 = specindex;
508 SB(
_m[t].m3, 4, 4, random_bits);
520 return GB(
_m[t].m3, 4, 4);
542 SB(
_me[t].m6, 2, 1, 0);
543 SB(
_me[t].m6, 3, 3, st);
575 MakeStation(t, o, sid, STATION_WAYPOINT, section + a);
628 MakeStation(t, o, sid, STATION_AIRPORT, section, wc);
uint32 TileIndex
The index/ID of a Tile.
@ TRACK_BIT_NONE
No track.
byte StationGfx
Copy from station_map.h.
static DiagDirection GetDockDirection(TileIndex t)
Get the direction of a dock.
static TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
static bool IsBusStop(TileIndex t)
Is the station at t a bus stop?
static bool IsRoadStop(TileIndex t)
Is the station at t a road station?
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
static bool IsRailWaypointTile(TileIndex t)
Is this tile a station tile and a rail waypoint?
static void SetTileType(TileIndex tile, TileType type)
Set the type of a tile.
static void SetCustomStationSpecIndex(TileIndex t, byte specindex)
Set the custom station spec for this tile.
static bool IsAirportTile(TileIndex t)
Is this tile a station tile and an airport tile?
static Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
static bool IsCustomStationSpecIndex(TileIndex t)
Is there a custom rail station spec on this tile?
static void SetRailStationReservation(TileIndex t, bool b)
Set the reservation state of the rail station.
@ DIAGDIR_END
Used for iterations.
static bool IsRailStation(TileIndex t)
Is this station tile a rail station?
static Track GetRailStationTrack(TileIndex t)
Get the rail track of a rail station tile.
static TrackBits AxisToTrackBits(Axis a)
Maps an Axis to the corresponding TrackBits value.
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 bool IsCompatibleTrainStationTile(TileIndex test_tile, TileIndex station_tile)
Check if a tile is a valid continuation to a railstation tile.
static RoadStopType GetRoadStopType(TileIndex t)
Get the road stop type of this tile.
uint16 m2
Primarily used for indices to towns, industries and stations.
static bool IsStandardRoadStopTile(TileIndex t)
Is tile t a standard (non-drive through) road stop station?
static void SetStationGfx(TileIndex t, StationGfx gfx)
Set the station graphics of this tile.
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
static void SetRoadOwner(TileIndex t, RoadTramType rtt, Owner o)
Set the owner of a specific road type.
static bool IsDriveThroughStopTile(TileIndex t)
Is tile t a drive through road stop station?
static void SetRoadTypes(TileIndex t, RoadType road_rt, RoadType tram_rt)
Set the present road types of a tile.
Owner
Enum for all companies/owners.
static bool IsTruckStop(TileIndex t)
Is the station at t a truck stop?
@ ROADSTOP_BUS
A standard stop for buses.
static void MakeRailWaypoint(TileIndex t, Owner o, StationID sid, Axis a, byte section, RailType rt)
Make the given tile a rail waypoint tile.
static void MakeBuoy(TileIndex t, StationID sid, WaterClass wc)
Make the given tile a buoy tile.
StationType
Station types.
static void MakeOilrig(TileIndex t, StationID sid, WaterClass wc)
Make the given tile an oilrig tile.
@ WATER_CLASS_INVALID
Used for industry tiles on land (also for oilrig if newgrf says so).
static void MakeStation(TileIndex t, Owner o, StationID sid, StationType st, byte section, WaterClass wc=WATER_CLASS_INVALID)
Make the given tile a station tile.
static StationGfx GetAirportGfx(TileIndex t)
Get the station graphics of this airport tile.
RailType
Enumeration for all possible railtypes.
static TrackBits GetRailStationTrackBits(TileIndex t)
Get the trackbits of a rail station tile.
static uint GetCustomStationSpecIndex(TileIndex t)
Get the custom station spec for this tile.
static bool HasStationRail(TileIndex t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
byte StationGfx
Index of station graphics.
static Track AxisToTrack(Axis a)
Convert an Axis to the corresponding Track AXIS_X -> TRACK_X AXIS_Y -> TRACK_Y Uses the fact that the...
bool IsHangar(TileIndex t)
Check whether the given tile is a hangar.
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 MakeDriveThroughRoadStop(TileIndex t, Owner station, Owner road, Owner tram, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, Axis a)
Make the given tile a drivethrough roadstop tile.
static bool IsBuoy(TileIndex t)
Is tile t a buoy tile?
static StationType GetStationType(TileIndex t)
Get the station type of this tile.
static bool HasStationTileRail(TileIndex t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
static void SetDockingTile(TileIndex t, bool b)
Set the docking tile state of a tile.
static void SetStationTileRandomBits(TileIndex t, byte random_bits)
Set the random bits for a station tile.
@ ROADSTOP_TRUCK
A standard stop for trucks.
static bool HasStationReservation(TileIndex t)
Get the reservation state of the rail station.
static void MakeAirport(TileIndex t, Owner o, StationID sid, byte section, WaterClass wc)
Make the given tile an airport tile.
static DiagDirection GetRoadStopDir(TileIndex t)
Gets the direction the road stop entrance points towards.
DiagDirection
Enumeration for diagonal directions.
static const int GFX_DOCK_BASE_WATER_PART
The offset for the water parts.
static bool IsRailStationTile(TileIndex t)
Is this tile a station tile and a rail station?
RoadType
The different roadtypes we support.
static const int GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET
The offset for the drive through parts.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a given tiletype.
static Owner GetTileOwner(TileIndex tile)
Returns the owner of a tile.
static bool IsAirport(TileIndex t)
Is this station tile an airport?
A pair-construct of a TileIndexDiff.
bool IsStationTileBlocked(TileIndex tile)
Check whether a rail station tile is NOT traversable.
static bool IsDockTile(TileIndex t)
Is tile t a dock tile?
static bool IsCompatibleRail(RailType enginetype, RailType tiletype)
Checks if an engine of the given RailType can drive on a tile with a given RailType.
static bool IsBuoyTile(TileIndex t)
Is tile t a buoy tile?
static bool IsRoadStopTile(TileIndex t)
Is tile t a road stop station?
static bool IsRailWaypoint(TileIndex t)
Is this station tile a rail waypoint?
static StationGfx GetStationGfx(TileIndex t)
Get the station graphics of this tile.
static Axis GetRailStationAxis(TileIndex t)
Get the rail direction of a rail station.
RoadStopType
Types of RoadStops.
@ OWNER_NONE
The tile has no ownership.
static RailType GetRailType(TileIndex t)
Gets the rail type of the given tile.
@ MP_STATION
A tile of a station.
static StationID GetStationIndex(TileIndex t)
Get StationID from a tile.
static void MakeRoadStop(TileIndex t, Owner o, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, DiagDirection d)
Make the given tile a roadstop tile.
StationGfx GetTranslatedAirportTileID(StationGfx gfx)
Do airporttile gfx ID translation for NewGRFs.
static byte GetStationTileRandomBits(TileIndex t)
Get the random bits of a station tile.
TrackBits
Bitfield corresponding to Track.
static bool IsDock(TileIndex t)
Is tile t a dock tile?
static bool IsOilRig(TileIndex t)
Is tile t part of an oilrig?
byte m7
Primarily used for newgrf support.
Axis
Allow incrementing of DiagDirDiff variables.
static void MakeRailStation(TileIndex t, Owner o, StationID sid, Axis a, byte section, RailType rt)
Make the given tile a rail station tile.
static void SetTileOwner(TileIndex tile, Owner owner)
Sets the owner of a tile.
static TrackBits GetStationReservationTrackBits(TileIndex t)
Get the reserved track bits for a waypoint.
static void SetWaterClass(TileIndex t, WaterClass wc)
Set the water class at a tile.
Track
These are used to specify a single track.
static void MakeDock(TileIndex t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
Make the given tile a dock tile.
uint16 m8
General purpose.
static TileIndexDiffC GetDockOffset(TileIndex t)
Get the tileoffset from this tile a ship should target to get to this dock.
static void SetRailType(TileIndex t, RailType r)
Sets the rail type of the given tile.
Tile * _m
Tiles of the map.
static bool IsHangarTile(TileIndex t)
Is tile t an hangar tile?