summaryrefslogtreecommitdiff
path: root/src/vehicle.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/vehicle.cpp
parente97c2bf6211478399723099ac9e50ba695e536b7 (diff)
downloadopenttd-a26ef1ee3aa21ff064d70971a4bb3605b40100db.tar.xz
(svn r10696) -Codechange: remove duplication of the "make sprite transparent" code.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index ee210f3ac..2e3e6e3fb 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -852,17 +852,14 @@ static void DoDrawVehicle(const Vehicle *v)
SpriteID image = v->cur_image;
SpriteID pal;
- if (v->vehstatus & VS_SHADOW) {
- SETBIT(image, PALETTE_MODIFIER_TRANSPARENT);
- pal = PALETTE_TO_TRANSPARENT;
- } else if (v->vehstatus & VS_DEFPAL) {
+ if (v->vehstatus & VS_DEFPAL) {
pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
} else {
pal = PAL_NONE;
}
AddSortableSpriteToDraw(image, pal, v->x_pos + v->x_offs, v->y_pos + v->y_offs,
- v->sprite_width, v->sprite_height, v->z_height, v->z_pos);
+ v->sprite_width, v->sprite_height, v->z_height, v->z_pos, v->vehstatus & VS_SHADOW);
}
void ViewportAddVehicles(DrawPixelInfo *dpi)