summaryrefslogtreecommitdiff
path: root/train_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
commita66e4c7e6cf8823418ff299a1b2d060a5491476c (patch)
tree8091f201e38eb46e57db61694b780a1cfa1b956b /train_gui.c
parent3efd51dd7688e7536eefd79448f88fc19585f8ce (diff)
downloadopenttd-a66e4c7e6cf8823418ff299a1b2d060a5491476c.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 'train_gui.c')
-rw-r--r--train_gui.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/train_gui.c b/train_gui.c
index 4540ce902..e7f1ace5b 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -358,14 +358,11 @@ static void DrawTrainImage(const Vehicle *v, int x, int y, int count, int skip,
do {
if (--skip < 0) {
- int image = GetTrainImage(v, 6);
- uint32 ormod = GetVehiclePalette(v);
int width = v->u.rail.cached_veh_length;
if (dx + width <= count) {
- if (v->vehstatus & VS_CRASHED)
- ormod = PALETTE_CRASH;
- DrawSprite(image | ormod, x + 14 + WagonLengthToPixels(dx), y + 6 + (is_custom_sprite(RailVehInfo(v->engine_type)->image_index) ? _traininfo_vehicle_pitch : 0));
+ PalSpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v);
+ DrawSprite(GetTrainImage(v, 6) | pal, x + 14 + WagonLengthToPixels(dx), y + 6 + (is_custom_sprite(RailVehInfo(v->engine_type)->image_index) ? _traininfo_vehicle_pitch : 0));
if (v->index == selection)
DrawFrameRect(x - 1 + WagonLengthToPixels(dx), y - 1, x + WagonLengthToPixels(dx + width) - 1, y + 12, 15, FR_BORDERONLY);
}