(svn r6652) -Feature: [depot window] depot lists are now sorted, so vehicle 1 is always first and so on

This should not be a big slowdown as it's only called each time the list is generated and will normally be much faster than the list generation itself (only a small % of the total number of vehicles is in the depot)
This commit is contained in:
bjarni
2006-10-05 13:11:17 +00:00
parent ea075f78e0
commit e341cc1e49
2 changed files with 8 additions and 0 deletions

View File

@@ -158,6 +158,11 @@ static void SortVehicleList(vehiclelist_d *vl)
vl->l.flags &= ~VL_RESORT;
}
void DepotSortList(Vehicle **v, uint16 length)
{
_internal_sort_order = 0;
qsort((void*)v, length, sizeof(v[0]), _vehicle_sorter[0]);
}
/* General Vehicle GUI based procedures that are independent of vehicle types */
void InitializeVehiclesGuiList(void)