summaryrefslogtreecommitdiff
path: root/vehicle_gui.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-10-05 13:11:17 +0000
committerbjarni <bjarni@openttd.org>2006-10-05 13:11:17 +0000
commite341cc1e496261fa9778b8bde19b1eae32b9f6b7 (patch)
tree7942be8ba2cb8f98d2c387536ad8f480ea94a314 /vehicle_gui.c
parentea075f78e04cc5675e890f82e181276ebc6b6f00 (diff)
downloadopenttd-e341cc1e496261fa9778b8bde19b1eae32b9f6b7.tar.xz
(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)
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r--vehicle_gui.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c
index d7d1992c8..e2d6eb2ad 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -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)