summaryrefslogtreecommitdiff
path: root/train_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-06-27 06:57:24 +0000
committertron <tron@openttd.org>2005-06-27 06:57:24 +0000
commitab7b8b50e34ffe0f0205399fc3a0fcefcff31741 (patch)
tree25912342dc104ba143e6030a35c59234dac9aef9 /train_gui.c
parent78fed5262724a4521a09fbf921b26a437fdeac41 (diff)
downloadopenttd-ab7b8b50e34ffe0f0205399fc3a0fcefcff31741.tar.xz
(svn r2492) Remove some pointless casts and fix some nearby indentation
Diffstat (limited to 'train_gui.c')
-rw-r--r--train_gui.c34
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);