From ab7b8b50e34ffe0f0205399fc3a0fcefcff31741 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 27 Jun 2005 06:57:24 +0000 Subject: (svn r2492) Remove some pointless casts and fix some nearby indentation --- train_gui.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'train_gui.c') diff --git a/train_gui.c b/train_gui.c index 70d3f31c9..fe0492646 100644 --- a/train_gui.c +++ b/train_gui.c @@ -370,17 +370,17 @@ static void DrawTrainDepotWindow(Window *w) hnum = 1; FOR_ALL_VEHICLES(v) { if (v->type == VEH_Train && - (v->subtype == TS_Front_Engine || v->subtype == TS_Free_Car) && - v->tile == (TileIndex)tile && + (v->subtype == TS_Front_Engine || v->subtype == TS_Free_Car) && + v->tile == tile && v->u.rail.track == 0x80) { - num++; - // determine number of items in the X direction. - if (v->subtype == TS_Front_Engine) { - i = 0; - u = v; - do i++; while ( (u=u->next) != NULL); - if (i > hnum) hnum = i; - } + num++; + // determine number of items in the X direction. + if (v->subtype == TS_Front_Engine) { + i = 0; + u = v; + do i++; while ((u = u->next) != NULL); + if (i > hnum) hnum = i; + } } } @@ -403,12 +403,9 @@ static void DrawTrainDepotWindow(Window *w) // draw all trains FOR_ALL_VEHICLES(v) { - if (v->type == VEH_Train && - v->subtype == TS_Front_Engine && - v->tile == (TileIndex)tile && - v->u.rail.track == 0x80 && + if (v->type == VEH_Train && v->subtype == TS_Front_Engine && + v->tile == tile && v->u.rail.track == 0x80 && --num < 0 && num >= -w->vscroll.cap) { - DrawTrainImage(v, x+21, y, w->hscroll.cap, w->hscroll.pos, WP(w,traindepot_d).sel); /* Draw the train number */ SetDParam(0, v->unitnumber); @@ -433,12 +430,9 @@ static void DrawTrainDepotWindow(Window *w) // draw all remaining vehicles FOR_ALL_VEHICLES(v) { - if (v->type == VEH_Train && - v->subtype == TS_Free_Car && - v->tile == (TileIndex)tile && - v->u.rail.track == 0x80 && + if (v->type == VEH_Train && v->subtype == TS_Free_Car && + v->tile == tile && v->u.rail.track == 0x80 && --num < 0 && num >= -w->vscroll.cap) { - DrawTrainImage(v, x+50, y, w->hscroll.cap - 1, 0, WP(w,traindepot_d).sel); DrawString(x, y+2, STR_8816, 0); -- cgit v1.2.3-54-g00ecf