summaryrefslogtreecommitdiff
path: root/src/newgrf_industrytiles.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/newgrf_industrytiles.cpp
parentd031da78d8271b8d57a0e2cd33b6c7d6e4231421 (diff)
downloadopenttd-02ab86631e59bc247b9f01c21b69e6f6b99a0d3f.tar.xz
(svn r10696) -Codechange: remove duplication of the "make sprite transparent" code.
Diffstat (limited to 'src/newgrf_industrytiles.cpp')
-rw-r--r--src/newgrf_industrytiles.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index ec7b269c5..ede452290 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -166,10 +166,7 @@ void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte r
image = dtss->image + stage;
pal = dtss->pal;
- if (!HASBIT(image, SPRITE_MODIFIER_OPAQUE) && HASBIT(_transparent_opt, TO_INDUSTRIES)) {
- SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
- pal = PALETTE_TO_TRANSPARENT;
- } else if (HASBIT(image, PALETTE_MODIFIER_COLOR)) {
+ if (HASBIT(image, PALETTE_MODIFIER_COLOR)) {
pal = GENERAL_SPRITE_COLOR(rnd_color);
} else {
pal = PAL_NONE;
@@ -180,7 +177,8 @@ void IndustryDrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte r
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
+ dtss->size_z, ti->z + dtss->delta_z,
+ !HASBIT(image, SPRITE_MODIFIER_OPAQUE) && HASBIT(_transparent_opt, TO_INDUSTRIES)
);
} else {
AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y);