MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IndustryDrawTileLayout

Function IndustryDrawTileLayout

src/newgrf_industrytiles.cpp:161–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161static void IndustryDrawTileLayout(const TileInfo *ti, const DrawTileSpriteSpan &dts, Colours rnd_colour, uint8_t stage)
162{
163 SpriteID image = dts.ground.sprite;
164 PaletteID pal = dts.ground.pal;
165
166 if (HasBit(image, SPRITE_MODIFIER_CUSTOM_SPRITE)) image += stage;
167 if (HasBit(pal, SPRITE_MODIFIER_CUSTOM_SPRITE)) pal += stage;
168
169 if (GB(image, 0, SPRITE_WIDTH) != 0) {
170 /* If the ground sprite is the default flat water sprite, draw also canal/river borders
171 * Do not do this if the tile's WaterClass is 'land'. */
172 if (image == SPR_FLAT_WATER_TILE && IsTileOnWater(ti->tile)) {
173 DrawWaterClassGround(ti);
174 } else {
175 DrawGroundSprite(image, GroundSpritePaletteTransform(image, pal, GetColourPalette(rnd_colour)));
176 }
177 }
178
179 DrawNewGRFTileSeq(ti, &dts, TO_INDUSTRIES, stage, GetColourPalette(rnd_colour));
180}
181
182uint16_t GetIndustryTileCallback(CallbackID callback, uint32_t param1, uint32_t param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile, std::span<int32_t> regs100)
183{

Callers 1

DrawNewIndustryTileFunction · 0.85

Calls 8

HasBitFunction · 0.85
GBFunction · 0.85
IsTileOnWaterFunction · 0.85
DrawWaterClassGroundFunction · 0.85
DrawGroundSpriteFunction · 0.85
GetColourPaletteFunction · 0.85
DrawNewGRFTileSeqFunction · 0.85

Tested by

no test coverage detected