|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
33 uint32_t
GetVariable(
byte variable, [[maybe_unused]] uint32_t parameter,
bool *available)
const override;
87 uint32_t connectivity =
103 Debug(grf, 1,
"Unhandled canal variable 0x{:02X}", variable);
116 return this->feature;
128 CallbackID callback, uint32_t callback_param1, uint32_t callback_param2)
129 :
ResolverObject(
_water_feature[feature].grffile, callback, callback_param1, callback_param2), canal_scope(*this, tile), feature(feature)
144 if (group ==
nullptr)
return 0;
146 return group->GetResult();
161 return object.ResolveCallback();
Resolver object for canals.
@ LOCK_PART_UPPER
Upper part of a lock.
Information about a water feature.
static uint16_t GetCanalCallback(CallbackID callback, uint32_t param1, uint32_t param2, CanalFeature feature, TileIndex tile)
Run a specific callback for canals.
byte GetLockPart(Tile t)
Get the part of a lock.
@ CBID_CANALS_SPRITE_OFFSET
Add an offset to the default sprite numbers to show another sprite.
Interface for SpriteGroup-s to access the gamestate.
int GetTileZ(TileIndex tile)
Get bottom height of the tile.
uint GetCanalSpriteOffset(CanalFeature feature, TileIndex tile, uint cur_offset)
Get the new sprite offset for a water tile.
uint32_t GetTerrainType(TileIndex tile, TileContext context)
Function used by houses (and soon industries) to get information on type of "terrain" the tile it is ...
CallbackID
List of implemented NewGRF callbacks.
@ CBM_CANAL_SPRITE_OFFSET
Enable add sprite offset callback.
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0) override
Get a resolver for the scope.
bool IsLock(Tile t)
Is there a lock on a given water tile?
#define Debug(category, level, format_string,...)
Ouptut a line of debugging information.
@ VSG_SCOPE_SELF
Resolved object itself.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
@ 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.
bool IsWateredTile(TileIndex tile, Direction from)
return true if a tile is a water tile wrt.
WaterFeature _water_feature[CF_END]
Table of canal 'feature' sprite groups.
uint32_t GetDebugID() const override
Get an identifier for the item being resolved.
SpriteID GetCanalSprite(CanalFeature feature, TileIndex tile)
Lookup the base sprite to use for a canal.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
byte GetWaterTileRandomBits(Tile t)
Get the random bits of the water tile.
uint32_t GetVariable(byte variable, [[maybe_unused]] uint32_t parameter, bool *available) const override
Get a variable value.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
TileIndex tile
Tile containing the canal.
static const uint CALLBACK_FAILED
Different values for Callback result evaluations.
CanalResolverObject(CanalFeature feature, TileIndex tile, CallbackID callback=CBID_NO_CALLBACK, uint32_t callback_param1=0, uint32_t callback_param2=0)
Canal resolver constructor.
uint32_t callback_param2
Second parameter (var 18) of the callback.
Scope resolver of a canal tile.
CallbackID callback
Callback being resolved.
uint32_t callback_param1
First parameter (var 10) of the callback.
#define TILE_ADDXY(tile, x, y)
Adds a given offset to a tile.
virtual const SpriteGroup * Resolve([[maybe_unused]] ResolverObject &object) const
Base sprite group resolver.
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
ResolverObject & ro
Surrounding resolver object.
uint32_t GetRandomBits() const override
Get a few random bits.
const SpriteGroup * group
Sprite group to start resolving.
CanalFeature
List of different canal 'features'.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.