Mercurial > hg > openttd
changeset 8705:7de4aaf3564a draft
(svn r12379) -Codechange: removed now redondant InvalidateWindow() calls
author | glx <glx@openttd.org> |
---|---|
date | Mon, 17 Mar 2008 22:04:15 +0000 (2008-03-17) |
parents | 1c8728113c57 |
children | 20434584b743 |
files | src/train_cmd.cpp |
diffstat | 1 files changed, 1 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -291,7 +291,7 @@ /* recalculate cached weights and power too (we do this *after* the rest, so it is known which wagons are powered and need extra weight added) */ TrainCargoChanged(v); - InvalidateWindow(WC_VEHICLE_DETAILS, v->index); + if (IsFrontEngine(v)) InvalidateWindow(WC_VEHICLE_DETAILS, v->index); } enum AccelType { @@ -1248,7 +1248,6 @@ UpdateTrainGroupID(src_head); if (IsFrontEngine(src_head)) { UpdateTrainAcceleration(src_head); - InvalidateWindow(WC_VEHICLE_DETAILS, src_head->index); /* Update the refit button and window */ InvalidateWindow(WC_VEHICLE_REFIT, src_head->index); InvalidateWindowWidget(WC_VEHICLE_VIEW, src_head->index, VVW_WIDGET_REFIT_VEH); @@ -1263,7 +1262,6 @@ UpdateTrainGroupID(dst_head); if (IsFrontEngine(dst_head)) { UpdateTrainAcceleration(dst_head); - InvalidateWindow(WC_VEHICLE_DETAILS, dst_head->index); /* Update the refit button and window */ InvalidateWindowWidget(WC_VEHICLE_VIEW, dst_head->index, VVW_WIDGET_REFIT_VEH); InvalidateWindow(WC_VEHICLE_REFIT, dst_head->index); @@ -1437,7 +1435,6 @@ TrainConsistChanged(first); UpdateTrainGroupID(first); if (IsFrontEngine(first)) { - InvalidateWindow(WC_VEHICLE_DETAILS, first->index); InvalidateWindow(WC_VEHICLE_REFIT, first->index); UpdateTrainAcceleration(first); } @@ -1507,7 +1504,6 @@ TrainConsistChanged(first); UpdateTrainGroupID(first); if (IsFrontEngine(first)) UpdateTrainAcceleration(first); - InvalidateWindow(WC_VEHICLE_DETAILS, first->index); InvalidateWindow(WC_VEHICLE_REFIT, first->index); } } break; @@ -3230,7 +3226,6 @@ } else { /* Recalculate cached train properties */ TrainConsistChanged(first); - InvalidateWindow(WC_VEHICLE_DETAILS, first->index); /* Update the depot window if the first vehicle is in depot - * if v == first, then it is updated in PreDestructor() */ if (first->u.rail.track == TRACK_BIT_DEPOT) {