(svn r18762) -Codechange: unduplicate sprite layout drawing between industries and houses
This commit is contained in:
@@ -173,7 +173,6 @@ static void NewIndustryTileResolver(ResolverObject *res, IndustryGfx gfx, TileIn
|
||||
static void IndustryDrawTileLayout(const TileInfo *ti, const TileLayoutSpriteGroup *group, byte rnd_colour, byte stage, IndustryGfx gfx)
|
||||
{
|
||||
const DrawTileSprites *dts = group->dts;
|
||||
const DrawTileSeqStruct *dtss;
|
||||
|
||||
SpriteID image = dts->ground.sprite;
|
||||
SpriteID pal = dts->ground.pal;
|
||||
@@ -190,32 +189,7 @@ static void IndustryDrawTileLayout(const TileInfo *ti, const TileLayoutSpriteGro
|
||||
}
|
||||
}
|
||||
|
||||
foreach_draw_tile_seq(dtss, dts->seq) {
|
||||
if (GB(dtss->image.sprite, 0, SPRITE_WIDTH) == 0) continue;
|
||||
|
||||
image = dtss->image.sprite;
|
||||
pal = dtss->image.pal;
|
||||
|
||||
/* Stop drawing sprite sequence once we meet a sprite that doesn't have to be opaque */
|
||||
if (IsInvisibilitySet(TO_INDUSTRIES) && !HasBit(image, SPRITE_MODIFIER_OPAQUE)) return;
|
||||
|
||||
if (IS_CUSTOM_SPRITE(image)) image += stage;
|
||||
|
||||
pal = SpriteLayoutPaletteTransform(image, pal, GENERAL_SPRITE_COLOUR(rnd_colour));
|
||||
|
||||
if ((byte)dtss->delta_z != 0x80) {
|
||||
AddSortableSpriteToDraw(
|
||||
image, pal,
|
||||
ti->x + dtss->delta_x, ti->y + dtss->delta_y,
|
||||
dtss->size_x, dtss->size_y,
|
||||
dtss->size_z, ti->z + dtss->delta_z,
|
||||
!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_INDUSTRIES)
|
||||
);
|
||||
} else {
|
||||
/* For industries and houses delta_x and delta_y are unsigned */
|
||||
AddChildSpriteScreen(image, pal, (byte)dtss->delta_x, (byte)dtss->delta_y, !HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_INDUSTRIES));
|
||||
}
|
||||
}
|
||||
DrawTileSeq(ti, dts, TO_INDUSTRIES, stage, GENERAL_SPRITE_COLOUR(rnd_colour));
|
||||
}
|
||||
|
||||
uint16 GetIndustryTileCallback(CallbackID callback, uint32 param1, uint32 param2, IndustryGfx gfx_id, Industry *industry, TileIndex tile)
|
||||
|
Reference in New Issue
Block a user