34 case 0x43:
return _date;
35 case 0x44:
return HZB_TOWN_EDGE;
49 t = Depot::GetByTile(this->
tile)->town;
57 DEBUG(grf, 1,
"Unhandled rail type tile variable 0x%X", variable);
96 assert(rtsg < RTSG_END);
98 if (rti->
group[rtsg] == NULL)
return 0;
102 if (group == NULL || group->GetNumResults() == 0)
return 0;
104 if (num_results) *num_results = group->GetNumResults();
106 return group->GetResult();
123 uint32 param1 = gui ? 0x10 : 0x00;
124 uint32 param2 = (type << 16) | (var << 8) | state;
128 if (group == NULL || group->GetNumResults() == 0)
return 0;
130 return group->GetResult();
147 if (index >= 0)
return index;
const SpriteGroup * group[RTSG_END]
Sprite groups for resolving sprites.
Resolver object for rail types.
NewGRF handling of rail types.
static const RailtypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
SignalType
Type of signal, i.e.
RailType
Enumeration for all possible railtypes.
Functions related to dates.
Functions related to debugging.
Interface for SpriteGroup-s to access the gamestate.
uint32 GetTerrainType(TileIndex tile, TileContext context)
Function used by houses (and soon industries) to get information on type of "terrain" the tile it is ...
SignalState
These are states in which a signal can be.
static uint TileX(TileIndex tile)
Get the X component of a tile.
Base for all depots (except hangars)
Set when using the callback resolve system, but not to resolve a callback.
byte num_loaded
Number of loaded groups.
static const uint TILE_SIZE
Tile size in world coordinates.
TileContext context
Are we resolving sprites for the upper halftile, or on a bridge?
This struct contains all the info that is needed to draw and construct tracks.
Date build_date
Date of construction.
const SpriteGroup * root_spritegroup
Root SpriteGroup to use for resolving.
Town * ClosestTownFromTile(TileIndex tile, uint threshold)
Return the town closest (in distance or ownership) to a given tile, within a given threshold...
SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSpriteGroup rtsg, TileContext context, uint *num_results)
Get the sprite to draw for the given tile.
virtual const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.
const SpriteGroup ** loaded
List of loaded groups (can be SpriteIDs or Callback results)
uint Length() const
Get the number of items in the list.
SmallVector< RailTypeLabel, 4 > railtype_list
Railtype translation table.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
TileIndex tile
Tracktile. For track on a bridge this is the southern bridgehead.
SpriteID GetCustomSignalSprite(const RailtypeInfo *rti, TileIndex tile, SignalType type, SignalVariant var, SignalState state, bool gui)
Get the sprite to draw for a given signal.
const SpriteGroup ** loading
List of loading groups (can be SpriteIDs or Callback results)
HouseZonesBits GetTownRadiusGroup(const Town *t, TileIndex tile)
Returns the bit corresponding to the town zone of the specified tile.
RailTypeLabel label
Unique 32 bit rail type identifier.
const SpriteGroup * ResolveReal(const RealSpriteGroup *group) const
Get the real sprites of the grf.
#define DEBUG(name, level,...)
Output a line of debugging information.
byte num_loading
Number of loading groups.
const GRFFile * grffile
GRFFile the resolved SpriteGroup belongs to.
RailTypeSpriteGroup
Sprite groups for a railtype.
int FindIndex(const T &item) const
Search for the first occurrence of an item.
static bool IsRailDepotTile(TileIndex t)
Is this tile rail tile and a rail depot?
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32 TileIndex
The index/ID of a Tile.
static bool IsLevelCrossingTile(TileIndex t)
Return whether a tile is a level crossing tile.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile)
Perform a reverse railtype lookup to get the GRF internal ID.
static uint CountBits(T value)
Counts the number of set bits in a variable.
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
static bool IsCrossingBarred(TileIndex t)
Check if the level crossing is barred.
SignalVariant
Variant of the signal, i.e.
Date _date
Current date in days (day counter)
RailTypeResolverObject(const RailtypeInfo *rti, TileIndex tile, TileContext context, RailTypeSpriteGroup rtsg, uint32 param1=0, uint32 param2=0)
Resolver object for rail types.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const
Get a variable value.
uint32 GetRandomBits() const
Get a few random bits.
Dynamic data of a loaded NewGRF.
TileContext
Context for tile accesses.