OpenTTD Source
12.0-beta2
|
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)dtss->
delta_x : dtss->
delta_x;
67 int offs_y = child_offset_is_unsigned ? (uint8)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)dtss->
delta_x : dtss->
delta_x;
127 int offs_y = child_offset_is_unsigned ? (uint8)dtss->delta_y : dtss->delta_y;
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.
@ SPRITE_MASK
The mask to for the main sprite.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
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.
uint x
X position of the tile in unit coordinates.
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
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 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...
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.
SpriteID sprite
The 'real' sprite.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
static int UnScaleGUI(int value)
Short-hand to apply GUI zoom level.
static const PaletteID PALETTE_TO_TRANSPARENT
This sets the sprite to transparent.
int16 x_offs
Number of pixels to shift the sprite to the right.
uint y
Y position of the tile in unit coordinates.
@ ST_NORMAL
The most basic (normal) sprite.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
int8 delta_x
0x80 is sequence terminator
int8 delta_z
0x80 identifies child sprites
@ SPRITE_MODIFIER_OPAQUE
Set when a sprite must not ever be displayed transparently.
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...
#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.
@ 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.
static int ScaleGUITrad(int value)
Scale traditional pixel dimensions to GUI zoom level.
uint32 PaletteID
The number of the palette.
int16 y_offs
Number of pixels to shift the sprite downwards.
const DrawTileSeqStruct * seq
Array of child sprites. Terminated with a terminator entry.
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
PaletteID pal
The palette (use PAL_NONE) if not needed)
Data structure describing a sprite.
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.
A tile child sprite and palette to draw for stations etc, with 3D bounding box.
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.