OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
32 case 0x43:
return _date;
33 case 0x44:
return HZB_TOWN_EDGE;
45 const Town *t =
nullptr;
47 t = Depot::GetByTile(this->
tile)->town;
55 DEBUG(grf, 1,
"Unhandled rail type tile variable 0x%X", variable);
104 assert(rtsg < RTSG_END);
106 if (rti->
group[rtsg] ==
nullptr)
return 0;
110 if (group ==
nullptr || group->GetNumResults() == 0)
return 0;
112 if (num_results) *num_results = group->GetNumResults();
114 return group->GetResult();
131 uint32 param1 = gui ? 0x10 : 0x00;
132 uint32 param2 = (type << 16) | (var << 8) | state;
136 if (group ==
nullptr || group->GetNumResults() == 0)
return 0;
138 return group->GetResult();
149 if (grffile ==
nullptr || grffile->
railtype_list.size() == 0) {
153 return static_cast<RailType>(railtype);
172 if (grffile ==
nullptr || grffile->
railtype_list.size() == 0)
return railtype;
178 if (idx >= 0)
return idx;
uint32 TileIndex
The index/ID of a Tile.
TileContext context
Are we resolving sprites for the upper halftile, or on a bridge?
const SpriteGroup ** loaded
List of loaded groups (can be SpriteIDs or Callback results)
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
Town * ClosestTownFromTile(TileIndex tile, uint threshold)
Return the town closest (in distance or ownership) to a given tile, within a given threshold.
byte num_loaded
Number of loaded groups.
uint32 GetRandomBits() const override
Get a few random bits.
@ RTSG_SIGNALS
Signal images.
Interface for SpriteGroup-s to access the gamestate.
This struct contains all the info that is needed to draw and construct tracks.
static const uint TILE_SIZE
Tile size in world coordinates.
SignalState
These are states in which a signal can be.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
RailTypeSpriteGroup
Sprite groups for a railtype.
static uint TileX(TileIndex tile)
Get the X component of a tile.
static uint CountBits(T value)
Counts the number of set bits in a variable.
SignalType
Type of signal, i.e.
HouseZonesBits GetTownRadiusGroup(const Town *t, TileIndex tile)
Returns the bit corresponding to the town zone of the specified tile.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
static const RailtypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
const SpriteGroup ** loading
List of loading groups (can be SpriteIDs or Callback results)
RailType
Enumeration for all possible railtypes.
Date _date
Current date in days (day counter)
#define DEBUG(name, level,...)
Output a line of debugging information.
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
const SpriteGroup * root_spritegroup
Root SpriteGroup to use for resolving.
int find_index(std::vector< T > const &vec, T const &item)
Helper function to get the index of an item Consider using std::set, std::unordered_set or std::flat_...
static bool IsCrossingBarred(TileIndex t)
Check if the level crossing is barred.
TileContext
Context for tile accesses.
static bool IsRailDepotTile(TileIndex t)
Is this tile rail tile and a rail depot?
uint32 GetDebugID() const override
Get an identifier for the item being resolved.
@ TCX_NORMAL
Nothing special.
TileIndex tile
Tracktile. For track on a bridge this is the southern bridgehead.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const override
Get a variable value.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
RailTypeResolverObject(const RailtypeInfo *rti, TileIndex tile, TileContext context, RailTypeSpriteGroup rtsg, uint32 param1=0, uint32 param2=0)
Resolver object for rail types.
const SpriteGroup * ResolveReal(const RealSpriteGroup *group) const override
Get the real sprites of the grf.
virtual const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.
SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context, uint *num_results)
Get the sprite to draw for the given tile.
SignalVariant
Variant of the signal, i.e.
@ RAILTYPE_END
Used for iterations.
RailTypeLabel label
Unique 32 bit rail type identifier.
SpriteID GetCustomSignalSprite(const RailtypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, SignalState state, bool gui)
Get the sprite to draw for a given signal.
RailType GetRailTypeTranslation(uint8 railtype, const GRFFile *grffile)
Translate an index to the GRF-local railtype-translation table into a RailType.
static bool IsLevelCrossingTile(TileIndex t)
Return whether a tile is a level crossing tile.
uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile)
Perform a reverse railtype lookup to get the GRF internal ID.
Date build_date
Date of construction.
byte num_loading
Number of loading groups.
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels)
Get the rail type for a given label.
Resolver object for rail types.
const SpriteGroup * group[RTSG_END]
Sprite groups for resolving sprites.
std::vector< RailTypeLabel > railtype_list
Railtype translation table.
uint32 GetTerrainType(TileIndex tile, TileContext context)
Function used by houses (and soon industries) to get information on type of "terrain" the tile it is ...
Dynamic data of a loaded NewGRF.
@ INVALID_RAILTYPE
Flag for invalid railtype.
RailTypeScopeResolver railtype_scope
Resolver for the railtype scope.