34 bool parent_sprite_encountered =
false;
36 bool skip_childs =
false;
59 parent_sprite_encountered =
true;
62 ti->
x + dtss->
delta_x, ti->
y + dtss->delta_y,
63 dtss->size_x, dtss->size_y,
68 int offs_x = child_offset_is_unsigned ? (uint8)dtss->
delta_x : dtss->
delta_x;
69 int offs_y = child_offset_is_unsigned ? (uint8)dtss->delta_y : dtss->delta_y;
71 if (parent_sprite_encountered) {
97 Point child_offset = {0, 0};
99 bool skip_childs =
false;
128 int offs_x = child_offset_is_unsigned ? (uint8)dtss->
delta_x : dtss->
delta_x;
129 int offs_y = child_offset_is_unsigned ? (uint8)dtss->delta_y : dtss->delta_y;
uint32 PaletteID
The number of the palette.
static const PaletteID PALETTE_TO_TRANSPARENT
This sets the sprite to transparent.
Tile information, used while rendering the tile.
void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig_offset, uint32 newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned)
Draws a tile sprite sequence in the GUI.
static int UnScaleGUI(int value)
Short-hand to apply GUI zoom level.
The mask to for the main sprite.
static 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...
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
Data structure describing a sprite.
static int ScaleGUITrad(int value)
Scale traditional pixel dimensions to GUI zoom level.
void DrawCommonTileSeq(const TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 orig_offset, uint32 newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned)
Draws a tile sprite sequence.
The most basic (normal) sprite.
const DrawTileSeqStruct * seq
Array of child sprites. Terminated with a terminator entry.
Functions related to (drawing on) viewports.
uint x
X position of the tile in unit coordinates.
int16 y_offs
Number of pixels to shift the sprite downwards.
Ground palette sprite of a tile, together with its sprite layout.
#define foreach_draw_tile_seq(idx, list)
Iterate through all DrawTileSeqStructs in DrawTileSprites.
Definition of base types and functions in a cross-platform compatible way.
A number of safeguards to prevent using unsafe methods.
uint y
Y position of the tile in unit coordinates.
Set when a sprite originates from an Action 1.
bool IsParentSprite() const
Check whether this is a parent sprite with a boundingbox.
number of bits for the sprite number
Functions to cache sprites in memory.
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.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
when a sprite is to be displayed transparently, this bit needs to be set.
int8 delta_z
0x80 identifies child sprites
static 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...
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
Functions related to zooming.
int16 x_offs
Number of pixels to shift the sprite to the right.
Functions related to OTTD's landscape.
Base for drawing complex sprites.
Coordinates of a point in 2D.
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.
void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent, const SubSprite *sub, bool scale)
Add a child sprite to a parent sprite.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
static 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 delta_x
0x80 is sequence terminator
SpriteID sprite
The 'real' sprite.
A tile child sprite and palette to draw for stations etc, with 3D bounding box.
Set when a sprite must not ever be displayed transparently.
static 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...
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
TransparencyOption
Transparency option bits: which position in _transparency_opt stands for which transparency.
PaletteID pal
The palette (use PAL_NONE) if not needed)