OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
32 bool parent_sprite_encountered =
false;
34 bool skip_childs =
false;
57 parent_sprite_encountered =
true;
60 ti->
x + dtss->
delta_x, ti->
y + dtss->delta_y,
61 dtss->size_x, dtss->size_y,
66 int offs_x = child_offset_is_unsigned ? (uint8_t)dtss->
delta_x : dtss->
delta_x;
67 int offs_y = child_offset_is_unsigned ? (uint8_t)dtss->delta_y : dtss->delta_y;
69 if (parent_sprite_encountered) {
95 Point child_offset = {0, 0};
97 bool skip_childs =
false;
126 int offs_x = child_offset_is_unsigned ? (uint8_t)dtss->
delta_x : dtss->
delta_x;
127 int offs_y = child_offset_is_unsigned ? (uint8_t)dtss->delta_y : dtss->delta_y;
@ SPRITE_MASK
The mask to for the main sprite.
constexpr T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
PaletteID SpriteLayoutPaletteTransform(SpriteID image, PaletteID pal, PaletteID default_pal)
Applies PALETTE_MODIFIER_TRANSPARENT and PALETTE_MODIFIER_COLOUR to a palette entry of a sprite layou...
int16_t x_offs
Number of pixels to shift the sprite to the right.
bool IsParentSprite() const
Check whether this is a parent sprite with a boundingbox.
Tile information, used while rendering the tile.
@ SPRITE_WIDTH
number of bits for the sprite number
constexpr static debug_inline uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
bool IsTransparencySet(TransparencyOption to)
Check if the transparency option bit is set and if we aren't in the game menu (there's never transpar...
SpriteID sprite
The 'real' sprite.
static const PaletteID PALETTE_TO_TRANSPARENT
This sets the sprite to transparent.
@ Normal
The most basic (normal) sprite.
int y
Y position of the tile in unit coordinates.
void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32_t orig_offset, uint32_t newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned)
Draws a tile sprite sequence in the GUI.
uint32_t PaletteID
The number of the palette.
bool IsInvisibilitySet(TransparencyOption to)
Check if the invisibility option bit is set and if we aren't in the game menu (there's never transpar...
int8_t delta_z
0x80 identifies child sprites
@ SPRITE_MODIFIER_OPAQUE
Set when a sprite must not ever be displayed transparently.
#define foreach_draw_tile_seq(idx, list)
Iterate through all DrawTileSeqStructs in DrawTileSprites.
@ SPRITE_MODIFIER_CUSTOM_SPRITE
Set when a sprite originates from an Action 1.
Ground palette sprite of a tile, together with its sprite layout.
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
Coordinates of a point in 2D.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
@ PALETTE_MODIFIER_TRANSPARENT
when a sprite is to be displayed transparently, this bit needs to be set.
void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w, int h, int dz, int z, bool transparent, int bb_offset_x, int bb_offset_y, int bb_offset_z, const SubSprite *sub)
Draw a (transparent) sprite at given coordinates with a given bounding box.
TransparencyOption
Transparency option bits: which position in _transparency_opt stands for which transparency.
int16_t y_offs
Number of pixels to shift the sprite downwards.
int ScaleSpriteTrad(int value)
Scale traditional pixel dimensions to GUI zoom level, for drawing sprites.
const DrawTileSeqStruct * seq
Array of child sprites. Terminated with a terminator entry.
int UnScaleGUI(int value)
Short-hand to apply GUI zoom level.
void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent, const SubSprite *sub, bool scale, bool relative)
Add a child sprite to a parent sprite.
int x
X position of the tile in unit coordinates.
PaletteID pal
The palette (use PAL_NONE) if not needed)
int8_t delta_x
0x80 is sequence terminator
Data structure describing a sprite.
void DrawCommonTileSeq(const TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32_t orig_offset, uint32_t newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned)
Draws a tile sprite sequence.
void DrawGroundSprite(SpriteID image, PaletteID pal, const SubSprite *sub, int extra_offs_x, int extra_offs_y)
Draws a ground sprite for the current tile.
Point RemapCoords(int x, int y, int z)
Map 3D world or tile coordinate to equivalent 2D coordinate as used in the viewports and smallmap.
A tile child sprite and palette to draw for stations etc, with 3D bounding box.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.