Base for drawing complex sprites. More...
#include "transparency.h"
#include "table/sprites.h"
Go to the source code of this file.
Data Structures | |
struct | DrawTileSeqStruct |
A tile child sprite and palette to draw for stations etc, with 3D bounding box. More... | |
struct | DrawTileSprites |
Ground palette sprite of a tile, together with its child sprites. More... | |
struct | DrawBuildingsTileStruct |
This structure is the same for both Industries and Houses. More... | |
Defines | |
#define | GENERAL_SPRITE_COLOUR(colour) ((colour) + PALETTE_RECOLOUR_START) |
#define | COMPANY_SPRITE_COLOUR(owner) (GENERAL_SPRITE_COLOUR(_company_colours[owner])) |
#define | foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) |
Iterate through all DrawTileSeqStructs in DrawTileSprites. | |
Functions | |
void | DrawCommonTileSeq (const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 orig_offset, uint32 newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned) |
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 void | DrawRailTileSeq (const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 total_offset, uint32 newgrf_offset, PaletteID default_palette) |
Draw tile sprite sequence on tile with railroad specifics. | |
static void | DrawRailTileSeqInGUI (int x, int y, const DrawTileSprites *dts, int32 total_offset, uint32 newgrf_offset, PaletteID default_palette) |
Draw tile sprite sequence in GUI with railroad specifics. | |
static void | DrawOrigTileSeq (const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, PaletteID default_palette) |
Draw TTD sprite sequence on tile. | |
static void | DrawOrigTileSeqInGUI (int x, int y, const DrawTileSprites *dts, PaletteID default_palette) |
Draw TTD sprite sequence in GUI. | |
static void | DrawNewGRFTileSeq (const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, uint32 stage, PaletteID default_palette) |
Draw NewGRF industrytile or house sprite layout. | |
static void | DrawNewGRFTileSeqInGUI (int x, int y, const DrawTileSprites *dts, uint32 stage, PaletteID default_palette) |
Draw NewGRF object in GUI. | |
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 layout entry for ground sprites use GroundSpritePaletteTransform Not useable for OTTD internal spritelayouts from table/xxx_land.h as PALETTE_MODIFIER_TRANSPARENT is only set when to use the default palette. | |
static PaletteID | GroundSpritePaletteTransform (SpriteID image, PaletteID pal, PaletteID default_pal) |
Applies PALETTE_MODIFIER_COLOUR to a palette entry of a ground sprite Not useable for OTTD internal spritelayouts from table/xxx_land.h as PALETTE_MODIFIER_TRANSPARENT is only set when to use the default palette. |
Base for drawing complex sprites.
Definition in file sprite.h.
#define foreach_draw_tile_seq | ( | idx, | |||
list | ) | for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) |
Iterate through all DrawTileSeqStructs in DrawTileSprites.
Definition at line 59 of file sprite.h.
Referenced by DrawCommonTileSeq(), and DrawCommonTileSeqInGUI().
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.
x | X position to draw to | |
y | Y position to draw to | |
dts | Sprite and subsprites to draw | |
orig_offset | Sprite-Offset for original sprites | |
newgrf_offset | Sprite-Offset for NewGRF defined sprites | |
default_palette | The default recolour sprite to use (typically company colour) | |
child_offset_is_unsigned | Whether child sprite offsets are interpreted signed or unsigned |
Definition at line 82 of file sprite.cpp.
References DrawTileSeqStruct::delta_x, DrawSprite(), foreach_draw_tile_seq, GB(), HasBit(), PalSpriteID::pal, RemapCoords(), DrawTileSprites::seq, PalSpriteID::sprite, SPRITE_MASK, SPRITE_MODIFIER_CUSTOM_SPRITE, SPRITE_WIDTH, SpriteLayoutPaletteTransform(), ST_NORMAL, Sprite::x_offs, and Sprite::y_offs.
Referenced by DrawNewGRFTileSeqInGUI(), DrawOrigTileSeqInGUI(), and DrawRailTileSeqInGUI().
static void DrawNewGRFTileSeq | ( | const struct TileInfo * | ti, | |
const DrawTileSprites * | dts, | |||
TransparencyOption | to, | |||
uint32 | stage, | |||
PaletteID | default_palette | |||
) | [inline, static] |
Draw NewGRF industrytile or house sprite layout.
stage | Sprite inside the Action1 spritesets to use, i.e. construction stage. |
Definition at line 104 of file sprite.h.
References DrawCommonTileSeq().
Referenced by DrawTileLayout().
static void DrawNewGRFTileSeqInGUI | ( | int | x, | |
int | y, | |||
const DrawTileSprites * | dts, | |||
uint32 | stage, | |||
PaletteID | default_palette | |||
) | [inline, static] |
Draw NewGRF object in GUI.
stage | Sprite inside the Action1 spritesets to use, i.e. construction stage. |
Definition at line 113 of file sprite.h.
References DrawCommonTileSeqInGUI().
Referenced by DrawNewObjectTileInGUI().
static void DrawRailTileSeq | ( | const struct TileInfo * | ti, | |
const DrawTileSprites * | dts, | |||
TransparencyOption | to, | |||
int32 | total_offset, | |||
uint32 | newgrf_offset, | |||
PaletteID | default_palette | |||
) | [inline, static] |
Draw tile sprite sequence on tile with railroad specifics.
total_offset | Spriteoffset from normal rail to current railtype. | |
newgrf_offset | Startsprite of the Action1 to use. |
Definition at line 69 of file sprite.h.
References DrawCommonTileSeq().
Referenced by DrawTile_Road().
static void DrawRailTileSeqInGUI | ( | int | x, | |
int | y, | |||
const DrawTileSprites * | dts, | |||
int32 | total_offset, | |||
uint32 | newgrf_offset, | |||
PaletteID | default_palette | |||
) | [inline, static] |
Draw tile sprite sequence in GUI with railroad specifics.
total_offset | Spriteoffset from normal rail to current railtype. | |
newgrf_offset | Startsprite of the Action1 to use. |
Definition at line 79 of file sprite.h.
References DrawCommonTileSeqInGUI().
Referenced by DrawStationTile().
static PaletteID GroundSpritePaletteTransform | ( | SpriteID | image, | |
PaletteID | pal, | |||
PaletteID | default_pal | |||
) | [inline, static] |
Applies PALETTE_MODIFIER_COLOUR to a palette entry of a ground sprite Not useable for OTTD internal spritelayouts from table/xxx_land.h as PALETTE_MODIFIER_TRANSPARENT is only set when to use the default palette.
image | The sprite to draw | |
pal | The palette from the sprite layout | |
default_pal | The default recolour sprite to use (typically company colour resp. random industry/house colour) |
Definition at line 148 of file sprite.h.
References HasBit(), and PALETTE_MODIFIER_COLOUR.
Referenced by DrawNewObjectTileInGUI(), DrawStationTile(), and DrawTileLayout().
static PaletteID SpriteLayoutPaletteTransform | ( | SpriteID | image, | |
PaletteID | pal, | |||
PaletteID | default_pal | |||
) | [inline, static] |
Applies PALETTE_MODIFIER_TRANSPARENT and PALETTE_MODIFIER_COLOUR to a palette entry of a sprite layout entry for ground sprites use GroundSpritePaletteTransform Not useable for OTTD internal spritelayouts from table/xxx_land.h as PALETTE_MODIFIER_TRANSPARENT is only set when to use the default palette.
image | The sprite to draw | |
pal | The palette from the sprite layout | |
default_pal | The default recolour sprite to use (typically company colour resp. random industry/house colour) |
Definition at line 129 of file sprite.h.
References HasBit(), and PALETTE_MODIFIER_COLOUR.
Referenced by DrawCommonTileSeq(), and DrawCommonTileSeqInGUI().