From 66fcdc5e6d014e57dadf2f420e91d2fc4643131f Mon Sep 17 00:00:00 2001 From: peter1138 Date: Tue, 7 Feb 2006 18:57:16 +0000 Subject: [PATCH] (svn r3571) - When loading a game, call TrainConsistChanged() for each train head separately before updating images, as v->first is used extensively in GetTrainImage() for custom graphics. This gives a significant speed improvement on loading a game. --- vehicle.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vehicle.c b/vehicle.c index 5d67f6200b..281053e744 100644 --- a/vehicle.c +++ b/vehicle.c @@ -218,6 +218,11 @@ void AfterLoadVehicles(void) FOR_ALL_VEHICLES(v) { v->first = NULL; + if (v->type == VEH_Train && (IsFrontEngine(v) || IsFreeWagon(v))) + TrainConsistChanged(v); + } + + FOR_ALL_VEHICLES(v) { if (v->type != 0) { switch (v->type) { case VEH_Train: v->cur_image = GetTrainImage(v, v->direction); break; @@ -234,9 +239,6 @@ void AfterLoadVehicles(void) v->left_coord = INVALID_COORD; VehiclePositionChanged(v); - - if (v->type == VEH_Train && (IsFrontEngine(v) || IsFreeWagon(v))) - TrainConsistChanged(v); } } }