diff options
author | rubidium <rubidium@openttd.org> | 2007-07-26 14:07:11 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-26 14:07:11 +0000 |
commit | 02ab86631e59bc247b9f01c21b69e6f6b99a0d3f (patch) | |
tree | f9ea4c50fe8ce5b57839ce0b5407aac9a6f2b452 /src/tree_cmd.cpp | |
parent | d031da78d8271b8d57a0e2cd33b6c7d6e4231421 (diff) | |
download | openttd-02ab86631e59bc247b9f01c21b69e6f6b99a0d3f.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.cpp | 11 |
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; } } |