10#ifndef NEWGRF_ROADTYPE_H
11#define NEWGRF_ROADTYPE_H
36 uint32_t
GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter,
bool &available)
const override;
64void ClearRoadTypeLabelList();
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
This file simplyfies and embeds a common mechanism of loading/saving and mapping of grf entities.
TileContext
Context for tile accesses.
@ TCX_NORMAL
Nothing special.
SpriteID GetCustomRoadSprite(const RoadTypeInfo *rti, TileIndex tile, RoadTypeSpriteGroup rtsg, TileContext context=TCX_NORMAL, uint *num_results=nullptr)
Get the sprite to draw for the given tile.
void SetCurrentRoadTypeLabelList()
Populate road type label list with current values.
void ConvertRoadTypes()
Test if any saved road type labels are different to the currently loaded road types.
uint8_t GetReverseRoadTypeTranslation(RoadType roadtype, const GRFFile *grffile)
Perform a reverse roadtype lookup to get the GRF internal ID.
RoadType GetRoadTypeTranslation(RoadTramType rtt, uint8_t tracktype, const GRFFile *grffile)
Translate an index to the GRF-local road/tramtype-translation table into a RoadType.
@ VSG_SCOPE_SELF
Resolved object itself.
RoadTypeSpriteGroup
Sprite groups for a roadtype.
RoadType
The different roadtypes we support.
Dynamic data of a loaded NewGRF.
Interface for SpriteGroup-s to access the gamestate.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0)
Get a resolver for the scope.
Resolver object for road types.
RoadTypeScopeResolver roadtype_scope
Resolver for the roadtype scope.
uint32_t GetDebugID() const override
Get an identifier for the item being resolved.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
Resolver for the railtype scope.
TileContext context
Are we resolving sprites for the upper halftile, or on a bridge?
RoadTypeScopeResolver(ResolverObject &ro, const RoadTypeInfo *rti, TileIndex tile, TileContext context)
Constructor of the roadtype scope resolvers.
uint32_t GetVariable(uint8_t variable, uint32_t parameter, bool &available) const override
Get a variable value.
uint32_t GetRandomBits() const override
Get a few random bits.
TileIndex tile
Tracktile. For track on a bridge this is the southern bridgehead.
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
ResolverObject & ro
Surrounding resolver object.