summaryrefslogtreecommitdiff
path: root/src/tree_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
commita26ef1ee3aa21ff064d70971a4bb3605b40100db (patch)
treef9ea4c50fe8ce5b57839ce0b5407aac9a6f2b452 /src/tree_cmd.cpp
parente97c2bf6211478399723099ac9e50ba695e536b7 (diff)
downloadopenttd-a26ef1ee3aa21ff064d70971a4bb3605b40100db.tar.xz
(svn r10696) -Codechange: remove duplication of the "make sprite transparent" code.
Diffstat (limited to 'src/tree_cmd.cpp')
-rw-r--r--src/tree_cmd.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index a19ff0ce7..a28bbbbb9 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -374,13 +374,8 @@ static void DrawTile_Trees(TileInfo *ti)
i = GetTreeCount(ti->tile) + 1;
do {
SpriteID image = s[0].sprite + (--i == 0 ? GetTreeGrowth(ti->tile) : 3);
- SpriteID pal;
- if (HASBIT(_transparent_opt, TO_TREES)) {
- SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
- pal = PALETTE_TO_TRANSPARENT;
- } else {
- pal = s[0].pal;
- }
+ SpriteID pal = s[0].pal;
+
te[i].image = image;
te[i].pal = pal;
te[i].x = d->x;
@@ -404,7 +399,7 @@ static void DrawTile_Trees(TileInfo *ti)
if (tep == NULL) break;
- AddSortableSpriteToDraw(tep->image, tep->pal, ti->x + tep->x, ti->y + tep->y, 5, 5, 0x10, z);
+ AddSortableSpriteToDraw(tep->image, tep->pal, ti->x + tep->x, ti->y + tep->y, 5, 5, 0x10, z, HASBIT(_transparent_opt, TO_TREES));
tep->image = 0;
}
}