mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-26 16:09:10 +00:00
(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.
This commit is contained in:
@@ -218,6 +218,11 @@ void AfterLoadVehicles(void)
|
|||||||
|
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
v->first = NULL;
|
v->first = NULL;
|
||||||
|
if (v->type == VEH_Train && (IsFrontEngine(v) || IsFreeWagon(v)))
|
||||||
|
TrainConsistChanged(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
FOR_ALL_VEHICLES(v) {
|
||||||
if (v->type != 0) {
|
if (v->type != 0) {
|
||||||
switch (v->type) {
|
switch (v->type) {
|
||||||
case VEH_Train: v->cur_image = GetTrainImage(v, v->direction); break;
|
case VEH_Train: v->cur_image = GetTrainImage(v, v->direction); break;
|
||||||
@@ -234,9 +239,6 @@ void AfterLoadVehicles(void)
|
|||||||
|
|
||||||
v->left_coord = INVALID_COORD;
|
v->left_coord = INVALID_COORD;
|
||||||
VehiclePositionChanged(v);
|
VehiclePositionChanged(v);
|
||||||
|
|
||||||
if (v->type == VEH_Train && (IsFrontEngine(v) || IsFreeWagon(v)))
|
|
||||||
TrainConsistChanged(v);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user