OpenTTD Source
20241108-master-g80f628063a
|
Wrapper class to abstract away the way the tiles are stored. More...
#include <map_func.h>
Data Structures | |
struct | TileBase |
Data that is stored per tile. More... | |
struct | TileExtended |
Data that is stored per tile. More... | |
Public Member Functions | |
debug_inline | Tile (TileIndex tile) |
Create the tile wrapper for the given tile. More... | |
Tile (uint tile) | |
Create the tile wrapper for the given tile. More... | |
constexpr debug_inline | operator TileIndex () const |
Implicit conversion to the TileIndex. | |
constexpr debug_inline | operator uint () const |
Implicit conversion to the uint for bounds checking. | |
debug_inline uint8_t & | type () |
The type (bits 4..7), bridges (2..3), rainforest/desert (0..1) More... | |
debug_inline uint8_t & | height () |
The height of the northern corner. More... | |
debug_inline uint8_t & | m1 () |
Primarily used for ownership information. More... | |
debug_inline uint16_t & | m2 () |
Primarily used for indices to towns, industries and stations. More... | |
debug_inline uint8_t & | m3 () |
General purpose. More... | |
debug_inline uint8_t & | m4 () |
General purpose. More... | |
debug_inline uint8_t & | m5 () |
General purpose. More... | |
debug_inline uint8_t & | m6 () |
General purpose. More... | |
debug_inline uint8_t & | m7 () |
Primarily used for newgrf support. More... | |
debug_inline uint16_t & | m8 () |
General purpose. More... | |
Private Attributes | |
TileIndex | tile |
The tile to access the map data for. | |
Static Private Attributes | |
static TileBase * | base_tiles = nullptr |
Pointer to the tile-array. More... | |
static TileExtended * | extended_tiles = nullptr |
Pointer to the extended tile-array. More... | |
Friends | |
struct | Map |
Wrapper class to abstract away the way the tiles are stored.
It is intended to be used to access the "map" data of a single tile.
The wrapper is expected to be fully optimized away by the compiler, even with low optimization levels except when completely disabling it.
Definition at line 25 of file map_func.h.
|
inline |
Create the tile wrapper for the given tile.
tile | The tile to access the map for. |
Definition at line 64 of file map_func.h.
|
inline |
Create the tile wrapper for the given tile.
tile | The tile to access the map for. |
Definition at line 70 of file map_func.h.
|
inline |
The height of the northern corner.
Look at docs/landscape.html for the exact meaning of the data.
tile | The tile to get the height for. |
Definition at line 101 of file map_func.h.
Referenced by SetTileHeight().
|
inline |
Primarily used for ownership information.
Look at docs/landscape.html for the exact meaning of the data.
tile | The tile to get the data for. |
Definition at line 113 of file map_func.h.
Referenced by GetHouseRandomBits(), GetIndustryConstructionCounter(), GetIndustryConstructionStage(), GetTileOwner(), GetWaterClass(), IsDockingTile(), IsIndustryCompleted(), MakeClear(), MakeField(), MakeHouseTile(), MakeIndustry(), MakeVoid(), ResetIndustryConstructionStage(), SetDockingTile(), SetHouseRandomBits(), SetIndustryCompleted(), SetIndustryConstructionCounter(), SetIndustryConstructionStage(), SetTileOwner(), and SetWaterClass().
|
inline |
Primarily used for indices to towns, industries and stations.
Look at docs/landscape.html for the exact meaning of the data.
tile | The tile to get the data for. |
Definition at line 125 of file map_func.h.
Referenced by GetDepotIndex(), GetIndustryIndex(), GetIndustryIndexOfField(), GetObjectIndex(), GetRailReservationTrackBits(), GetStationIndex(), GetTownIndex(), GetTreeDensity(), GetTreeGround(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeHouseTile(), MakeIndustry(), MakeLockTile(), MakeObject(), MakeRailDepot(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeVoid(), MakeWater(), MoveWaypointsToBaseStations(), SetIndustryIndexOfField(), SetTownIndex(), SetTrackReservation(), and SetTreeGroundDensity().
|
inline |
General purpose.
Look at docs/landscape.html for the exact meaning of the data.
tile | The tile to get the data for. |
Definition at line 137 of file map_func.h.
Referenced by ClearSnow(), GetCleanHouseType(), GetFieldType(), GetHouseTriggers(), GetIndustryRandomBits(), GetObjectRandomBits(), GetPresentSignals(), GetRoadWaypointRoadside(), GetStationTileRandomBits(), GetTreeType(), IsHouseCompleted(), IsNonFloodingWaterTile(), IsSnowTile(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeHouseTile(), MakeLockTile(), MakeObject(), MakeRailDepot(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeSnow(), MakeStation(), MakeTree(), MakeVoid(), MakeWater(), MoveWaypointsToBaseStations(), SetFieldType(), SetHouseCompleted(), SetHouseTriggers(), SetHouseType(), SetIndustryRandomBits(), SetNonFloodingWaterTile(), SetPresentSignals(), SetRoadWaypointRoadside(), and SetStationTileRandomBits().
|
inline |
General purpose.
Look at docs/landscape.html for the exact meaning of the data.
tile | The tile to get the data for. |
Definition at line 149 of file map_func.h.
Referenced by GetCleanHouseType(), GetCustomStationSpecIndex(), GetIndustryAnimationLoop(), GetSignalStates(), GetWaterTileRandomBits(), IsCustomStationSpecIndex(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeIndustry(), MakeLockTile(), MakeObject(), MakeRailDepot(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeVoid(), MakeWater(), MoveWaypointsToBaseStations(), SetCustomStationSpecIndex(), SetHouseType(), SetIndustryAnimationLoop(), and SetSignalStates().
|
inline |
General purpose.
Look at docs/landscape.html for the exact meaning of the data.
tile | The tile to get the data for. |
Definition at line 161 of file map_func.h.
Referenced by AddClearCounter(), AddClearDensity(), AddTreeCount(), AddTreeGrowth(), GetCleanIndustryGfx(), GetClearCounter(), GetClearDensity(), GetCrossingRoadAxis(), GetDisallowedRoadDirections(), GetHouseAge(), GetHouseBuildingStage(), GetHouseConstructionTick(), GetLockDirection(), GetLockPart(), GetObjectIndex(), GetRailDepotDirection(), GetRawClearGround(), GetRoadDepotDirection(), GetShipDepotAxis(), GetShipDepotPart(), GetStationGfx(), GetTrackBits(), GetTreeCount(), GetTreeGrowth(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), GetWaterTileType(), HasCrossingReservation(), HasDepotReservation(), HasTunnelBridgeReservation(), IncHouseConstructionTick(), IncrementHouseAge(), IsBridge(), IsCrossingBarred(), IsTunnel(), MakeBridgeRamp(), MakeHouseTile(), MakeLockTile(), MakeObject(), MakeRailDepot(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeVoid(), MakeWater(), MoveWaypointsToBaseStations(), ResetHouseAge(), SetClearCounter(), SetClearDensity(), SetClearGroundDensity(), SetCrossingBarred(), SetCrossingReservation(), SetDepotReservation(), SetDisallowedRoadDirections(), SetHasSignals(), SetIndustryGfx(), SetRailDepotExitDirection(), SetRoadDepotExitDirection(), SetStationGfx(), SetTrackBits(), SetTreeGrowth(), SetTunnelBridgeReservation(), and SetWaterTileType().
|
inline |
General purpose.
Look at docs/landscape.html for the exact meaning of the data.
tile | The tile to get the data for. |
Definition at line 173 of file map_func.h.
Referenced by CanStationTileHavePylons(), CanStationTileHaveWires(), DecHouseProcessingTime(), GetBridgeType(), GetCleanIndustryGfx(), GetHouseProcessingTime(), GetIndustryTriggers(), GetLiftPosition(), GetRoadside(), GetStationType(), HasStationReservation(), IsStationTileBlocked(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeLockTile(), MakeObject(), MakeRailDepot(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeVoid(), MakeWater(), MoveBuoysToWaypoints(), SetHouseProcessingTime(), SetIndustryGfx(), SetIndustryTriggers(), SetLiftPosition(), SetRailStationReservation(), SetRoadside(), SetStationTileBlocked(), SetStationTileHavePylons(), and SetStationTileHaveWires().
|
inline |
Primarily used for newgrf support.
Look at docs/landscape.html for the exact meaning of the data.
tile | The tile to get the data for. |
Definition at line 185 of file map_func.h.
Referenced by GetAnimationFrame(), GetLiftDestination(), HaltLift(), HasTunnelBridgeSnowOrDesert(), IncreaseRoadWorksCounter(), IsOnSnow(), LiftHasDestination(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeIndustry(), MakeLockTile(), MakeObject(), MakeRailDepot(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeVoid(), MakeWater(), SetAnimationFrame(), SetLiftDestination(), SetTunnelBridgeSnowOrDesert(), TerminateRoadWorks(), and ToggleSnow().
|
inline |
General purpose.
Look at docs/landscape.html for the exact meaning of the data.
tile | The tile to get the data for. |
Definition at line 197 of file map_func.h.
Referenced by GetCustomRoadStopSpecIndex(), GetRailType(), IsCustomRoadStopSpecIndex(), IsRoadWaypointOnSnowOrDesert(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeRailDepot(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadTunnel(), MakeStation(), SetCustomRoadStopSpecIndex(), SetRailType(), and ToggleRoadWaypointOnSnowOrDesert().
|
inline |
The type (bits 4..7), bridges (2..3), rainforest/desert (0..1)
Look at docs/landscape.html for the exact meaning of the data.
tile | The tile to get the data for. |
Definition at line 89 of file map_func.h.
Referenced by ClearSingleBridgeMiddle(), GetBridgeAxis(), GetTropicZone(), IsBridgeAbove(), SetBridgeMiddle(), SetTileType(), and SetTropicZone().
|
staticprivate |
Pointer to the tile-array.
Base tiles of the map.
Definition at line 54 of file map_func.h.
Referenced by Map::IsInitialized().
|
staticprivate |
Pointer to the extended tile-array.
Extended tiles of the map.
Definition at line 55 of file map_func.h.