Mercurial > hg > openttd
diff src/industry_cmd.cpp @ 7333:7110c41ab174 draft
(svn r10696) -Codechange: remove duplication of the "make sprite transparent" code.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Thu, 26 Jul 2007 14:07:11 +0000 (2007-07-26) |
parents | d2b2514b2a5f |
children | e9bc6de8292f |
line wrap: on
line diff
--- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -299,22 +299,15 @@ /* Add industry on top of the ground? */ image = dits->building.sprite; if (image != 0) { - if (HASBIT(_transparent_opt, TO_INDUSTRIES)) { - SETBIT(image, PALETTE_MODIFIER_TRANSPARENT); - pal = PALETTE_TO_TRANSPARENT; - } else if (HASBIT(image, PALETTE_MODIFIER_COLOR) && dits->building.pal == PAL_NONE) { - pal = GENERAL_SPRITE_COLOR(ind->random_color); - } else { - pal = dits->building.pal; - } - - AddSortableSpriteToDraw(image, pal, + AddSortableSpriteToDraw(image, + (HASBIT(image, PALETTE_MODIFIER_COLOR) && dits->building.pal == PAL_NONE) ? GENERAL_SPRITE_COLOR(ind->random_color) : dits->building.pal, ti->x + dits->subtile_x, ti->y + dits->subtile_y, dits->width + 1, dits->height + 1, dits->dz, - z); + z, + HASBIT(_transparent_opt, TO_INDUSTRIES)); if (HASBIT(_transparent_opt, TO_INDUSTRIES)) return; }