summaryrefslogtreecommitdiff
path: root/roadveh_gui.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-02-20 21:49:31 +0000
committerpeter1138 <peter1138@openttd.org>2006-02-20 21:49:31 +0000
commit97559a9df9e1255f6d7caa2c1851f35c10f28841 (patch)
tree8091f201e38eb46e57db61694b780a1cfa1b956b /roadveh_gui.c
parentd77d704d27e2d86be77c39d687bd1af17dbe05f2 (diff)
downloadopenttd-97559a9df9e1255f6d7caa2c1851f35c10f28841.tar.xz
(svn r3631) - 2cc: Remove use of some temporary variables and perform minor optimization in the form of the ternary operator.
Diffstat (limited to 'roadveh_gui.c')
-rw-r--r--roadveh_gui.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/roadveh_gui.c b/roadveh_gui.c
index 2c90b38ae..2d8a1826c 100644
--- a/roadveh_gui.c
+++ b/roadveh_gui.c
@@ -64,10 +64,8 @@ void DrawRoadVehPurchaseInfo(int x, int y, EngineID engine_number)
static void DrawRoadVehImage(const Vehicle *v, int x, int y, VehicleID selection)
{
- int image = GetRoadVehImage(v, 6);
- uint32 ormod = GetVehiclePalette(v);
- if (v->vehstatus & VS_CRASHED) ormod = PALETTE_CRASH;
- DrawSprite(image | ormod, x + 14, y + 6);
+ PalSpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
+ DrawSprite(GetRoadVehImage(v, 6) | pal, x + 14, y + 6);
if (v->index == selection) {
DrawFrameRect(x - 1, y - 1, x + 28, y + 12, 15, FR_BORDERONLY);