(svn r6582) -Codechange: changed GenerateVehicleSortList() to reuse the same allocation over and over if possible (like BuildDepotVehicleList() )
This will prevent some reallocations when sorting vehicle list windows It also prevents moving the whole array into a new one each time the list is generated/updated (it used to make the list in one array and then move it into another one each time) Also ensured that neither GenerateVehicleSortList() or BuildDepotVehicleList() will never allocate lists longer than the total number of vehicles in the game
This commit is contained in:
@@ -317,7 +317,7 @@ int CheckTrainStoppedInDepot(const Vehicle *v);
|
||||
|
||||
bool VehicleNeedsService(const Vehicle *v);
|
||||
|
||||
uint GenerateVehicleSortList(const Vehicle** sort_list, byte type, PlayerID owner, StationID station, OrderID order, uint16 window_type);
|
||||
uint GenerateVehicleSortList(const Vehicle*** sort_list, uint16 *length_of_array, byte type, PlayerID owner, StationID station, OrderID order, uint16 window_type);
|
||||
void BuildDepotVehicleList(byte type, TileIndex tile, Vehicle ***engine_list, uint16 *engine_list_length, uint16 *engine_count, Vehicle ***wagon_list, uint16 *wagon_list_length, uint16 *wagon_count);
|
||||
int32 SendAllVehiclesToDepot(byte type, uint32 flags, bool service, PlayerID owner, uint16 vlw_flag, uint32 id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user