summaryrefslogtreecommitdiff
path: root/src/industry_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-26 14:07:11 +0000
committerrubidium <rubidium@openttd.org>2007-07-26 14:07:11 +0000
commit02ab86631e59bc247b9f01c21b69e6f6b99a0d3f (patch)
treef9ea4c50fe8ce5b57839ce0b5407aac9a6f2b452 /src/industry_cmd.cpp
parentd031da78d8271b8d57a0e2cd33b6c7d6e4231421 (diff)
downloadopenttd-02ab86631e59bc247b9f01c21b69e6f6b99a0d3f.tar.xz
(svn r10696) -Codechange: remove duplication of the "make sprite transparent" code.
Diffstat (limited to 'src/industry_cmd.cpp')
-rw-r--r--src/industry_cmd.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 958f1a013..fc307beed 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -299,22 +299,15 @@ static void DrawTile_Industry(TileInfo *ti)
/* 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;
}