Mercurial > hg > openttd
comparison src/sprite.h @ 14294:7718a19fd027 draft
(svn r18846) -Codechange: Merge DrawTileSeq into DrawCommonTileSeq.
author | frosch <frosch@openttd.org> |
---|---|
date | Sun, 17 Jan 2010 15:05:25 +0000 |
parents | 9a47b3371031 |
children | 72cb3c72d619 |
comparison
equal
deleted
inserted
replaced
14293:1d93646afcfa | 14294:7718a19fd027 |
---|---|
57 }; | 57 }; |
58 | 58 |
59 /** Iterate through all DrawTileSeqStructs in DrawTileSprites. */ | 59 /** Iterate through all DrawTileSeqStructs in DrawTileSprites. */ |
60 #define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) | 60 #define foreach_draw_tile_seq(idx, list) for (idx = list; ((byte) idx->delta_x) != 0x80; idx++) |
61 | 61 |
62 void DrawCommonTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 orig_offset, uint32 newgrf_offset, SpriteID default_palette); | 62 void DrawCommonTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 orig_offset, uint32 newgrf_offset, SpriteID default_palette, bool child_offset_is_unsigned); |
63 void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig_offset, uint32 newgrf_offset, SpriteID default_palette); | 63 void DrawCommonTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 orig_offset, uint32 newgrf_offset, SpriteID default_palette, bool child_offset_is_unsigned); |
64 | 64 |
65 bool SkipSpriteData(byte type, uint16 num); | 65 /** |
66 * Draw tile sprite sequence on tile with railroad specifics. | |
67 * @param total_offset Spriteoffset from normal rail to current railtype. | |
68 * @param newgrf_offset Startsprite of the Action1 to use. | |
69 */ | |
70 static inline void DrawRailTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 total_offset, uint32 newgrf_offset, SpriteID default_palette) | |
71 { | |
72 DrawCommonTileSeq(ti, dts, to, total_offset, newgrf_offset, default_palette, false); | |
73 } | |
74 | |
75 /** | |
76 * Draw tile sprite sequence in GUI with railroad specifics. | |
77 * @param total_offset Spriteoffset from normal rail to current railtype. | |
78 * @param newgrf_offset Startsprite of the Action1 to use. | |
79 */ | |
80 static inline void DrawRailTileSeqInGUI(int x, int y, const DrawTileSprites *dts, int32 total_offset, uint32 newgrf_offset, SpriteID default_palette) | |
81 { | |
82 DrawCommonTileSeqInGUI(x, y, dts, total_offset, newgrf_offset, default_palette, false); | |
83 } | |
84 | |
85 /** | |
86 * Draw TTD sprite sequence on tile. | |
87 */ | |
88 static inline void DrawOrigTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, SpriteID default_palette) | |
89 { | |
90 DrawCommonTileSeq(ti, dts, to, 0, 0, default_palette, false); | |
91 } | |
92 | |
93 /** | |
94 * Draw TTD sprite sequence in GUI. | |
95 */ | |
96 static inline void DrawOrigTileSeqInGUI(int x, int y, const DrawTileSprites *dts, SpriteID default_palette) | |
97 { | |
98 DrawCommonTileSeqInGUI(x, y, dts, 0, 0, default_palette, false); | |
99 } | |
100 | |
101 /** | |
102 * Draw NewGRF industrytile or house sprite layout | |
103 * @param stage Sprite inside the Action1 spritesets to use, i.e. construction stage. | |
104 */ | |
105 static inline void DrawNewGRFTileSeq(const struct TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, uint32 stage, SpriteID default_palette) | |
106 { | |
107 DrawCommonTileSeq(ti, dts, to, 0, stage, default_palette, true); | |
108 } | |
66 | 109 |
67 /** | 110 /** |
68 * Applies PALETTE_MODIFIER_TRANSPARENT and PALETTE_MODIFIER_COLOUR to a palette entry of a sprite layout entry | 111 * Applies PALETTE_MODIFIER_TRANSPARENT and PALETTE_MODIFIER_COLOUR to a palette entry of a sprite layout entry |
69 * @Note for ground sprites use #GroundSpritePaletteTransform | 112 * @Note for ground sprites use #GroundSpritePaletteTransform |
70 * @Note Not useable for OTTD internal spritelayouts from table/xxx_land.h as PALETTE_MODIFIER_TRANSPARENT is only set | 113 * @Note Not useable for OTTD internal spritelayouts from table/xxx_land.h as PALETTE_MODIFIER_TRANSPARENT is only set |