diff options
author | bjarni <bjarni@openttd.org> | 2006-09-29 20:41:28 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2006-09-29 20:41:28 +0000 |
commit | 043f72678f451334e92667467ef28f1b61e0e87e (patch) | |
tree | 24bf8ab6f6d2bc50cb74cdbe470a510e7e6aaac1 /vehicle.h | |
parent | 7c863e67637e696d8880467920672490d41c2168 (diff) | |
download | openttd-043f72678f451334e92667467ef28f1b61e0e87e.tar.xz |
(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
Diffstat (limited to 'vehicle.h')
-rw-r--r-- | vehicle.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |