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);
Owner
Enum for all companies/owners.
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 MakeDock(TileIndex t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
Make the given tile a dock tile.
static TrackBits GetStationReservationTrackBits(TileIndex t)
Get the reserved track bits for a waypoint.
static void SetCustomStationSpecIndex(TileIndex t, byte specindex)
Set the custom station spec for this tile.
A standard stop for trucks.
static bool IsCustomStationSpecIndex(TileIndex t)
Is there a custom rail station spec on this tile?
static void SetTileOwner(TileIndex tile, Owner owner)
Sets the owner of a tile.
static bool IsAirportTile(TileIndex t)
Is this tile a station tile and an airport tile?
static bool IsRailStation(TileIndex t)
Is this station tile a rail station?
static RoadStopType GetRoadStopType(TileIndex t)
Get the road stop type of this tile.
byte m7
Primarily used for newgrf support.
uint16 m2
Primarily used for indices to towns, industries and stations.
static TrackBits AxisToTrackBits(Axis a)
Maps an Axis to the corresponding TrackBits value.
Tile * _m
Tiles of the map.
static bool IsRoadStop(TileIndex t)
Is the station at t a road station?
static DiagDirection GetDockDirection(TileIndex t)
Get the direction of a dock.
A standard stop for buses.
static void MakeOilrig(TileIndex t, StationID sid, WaterClass wc)
Make the given tile an oilrig tile.
static StationGfx GetAirportGfx(TileIndex t)
Get the station graphics of this airport tile.
static bool IsRailWaypointTile(TileIndex t)
Is this tile a station tile and a rail waypoint?
static void SetRailStationReservation(TileIndex t, bool b)
Set the reservation state of the rail station.
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...
static Track GetRailStationTrack(TileIndex t)
Get the rail track of a rail station tile.
static void MakeBuoy(TileIndex t, StationID sid, WaterClass wc)
Make the given tile a buoy tile.
static bool IsStandardRoadStopTile(TileIndex t)
Is tile t a standard (non-drive through) road stop station?
static void SetWaterClass(TileIndex t, WaterClass wc)
Set the water class at a tile.
RoadType
The different roadtypes we support.
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.
static StationType GetStationType(TileIndex t)
Get the station type of this tile.
RoadStopType
Types of RoadStops.
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 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...
static bool IsCompatibleTrainStationTile(TileIndex test_tile, TileIndex station_tile)
Check if a tile is a valid continuation to a railstation tile.
The tile has no ownership.
static TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
static void SetStationTileRandomBits(TileIndex t, byte random_bits)
Set the random bits for a station tile.
static bool IsBuoy(TileIndex t)
Is tile t a buoy tile?
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a given tiletype.
static void MakeAirport(TileIndex t, Owner o, StationID sid, byte section, WaterClass wc)
Make the given tile an airport tile.
static const int GFX_DOCK_BASE_WATER_PART
The offset for the water parts.
static void MakeRailWaypoint(TileIndex t, Owner o, StationID sid, Axis a, byte section, RailType rt)
Make the given tile a rail waypoint tile.
static bool HasStationReservation(TileIndex t)
Get the reservation state of the rail station.
static bool IsRailStationTile(TileIndex t)
Is this tile a station tile and a rail 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 bool IsTruckStop(TileIndex t)
Is the station at t a truck stop?
static DiagDirection GetRoadStopDir(TileIndex t)
Gets the direction the road stop entrance points towards.
static Owner GetTileOwner(TileIndex tile)
Returns the owner of a tile.
bool IsHangar(TileIndex t)
Check whether the given tile is a hangar.
static TrackBits GetRailStationTrackBits(TileIndex t)
Get the trackbits of a rail station tile.
Map accessors for water tiles.
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 const int GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET
The offset for the drive through parts.
static bool IsDockTile(TileIndex t)
Is tile t a dock tile?
TileExtended * _me
Extended Tiles of the map.
static Axis GetRailStationAxis(TileIndex t)
Get the rail direction of a rail station.
static bool IsBuoyTile(TileIndex t)
Is tile t a buoy tile?
static bool IsAirport(TileIndex t)
Is this station tile an airport?
TrackBits
Bitfield corresponding to Track.
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 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.
Functions related to stations.
byte StationGfx
Index of station graphics.
static StationGfx GetStationGfx(TileIndex t)
Get the station graphics of this tile.
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 void SetRoadOwner(TileIndex t, RoadTramType rtt, Owner o)
Set the owner of a specific road type.
A pair-construct of a TileIndexDiff.
static Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
byte StationGfx
Copy from station_map.h.
static StationID GetStationIndex(TileIndex t)
Get StationID from a tile.
StationType
Station types.
RailType
Enumeration for all possible railtypes.
bool IsStationTileBlocked(TileIndex tile)
Check whether a rail station tile is NOT traversable.
uint32 TileIndex
The index/ID of a Tile.
Track
These are used to specify a single track.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
static bool IsOilRig(TileIndex t)
Is tile t part of an oilrig?
static void SetTileType(TileIndex tile, TileType type)
Set the type of a 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 IsRailWaypoint(TileIndex t)
Is this station tile a rail waypoint?
uint16 m8
General purpose.
static bool IsRoadStopTile(TileIndex t)
Is tile t a road stop station?
static TileIndexDiffC GetDockOffset(TileIndex t)
Get the tileoffset from this tile a ship should target to get to this dock.
static bool IsHangarTile(TileIndex t)
Is tile t an hangar tile?
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
DiagDirection
Enumeration for diagonal directions.
StationGfx GetTranslatedAirportTileID(StationGfx gfx)
Do airporttile gfx ID translation for NewGRFs.
static bool IsDock(TileIndex t)
Is tile t a dock tile?
static void SetDockingTile(TileIndex t, bool b)
Set the docking tile state of a tile.
static byte GetStationTileRandomBits(TileIndex t)
Get the random bits of a station tile.
static bool IsBusStop(TileIndex t)
Is the station at t a bus stop?
Hides the direct accesses to the map array with map accessors.
Axis
Allow incrementing of DiagDirDiff variables.
Used for industry tiles on land (also for oilrig if newgrf says so).
static RailType GetRailType(TileIndex t)
Gets the rail type of the given tile.
static void SetRailType(TileIndex t, RailType r)
Sets the rail type of the given tile.