diff options
author | tron <tron@openttd.org> | 2005-06-27 06:57:24 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-06-27 06:57:24 +0000 |
commit | 5cbd8b598ced72ad2756c40d3c4fc15a9f247fc9 (patch) | |
tree | 25912342dc104ba143e6030a35c59234dac9aef9 /train_gui.c | |
parent | 48ff5e39dc523dcfd448006ab3232599e2792178 (diff) | |
download | openttd-5cbd8b598ced72ad2756c40d3c4fc15a9f247fc9.tar.xz |
(svn r2492) Remove some pointless casts and fix some nearby indentation
Diffstat (limited to 'train_gui.c')
-rw-r--r-- | train_gui.c | 34 |
1 files changed, 14 insertions, 20 deletions
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); |