diff options
author | bjarni <bjarni@openttd.org> | 2006-10-05 13:11:17 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2006-10-05 13:11:17 +0000 |
commit | e341cc1e496261fa9778b8bde19b1eae32b9f6b7 (patch) | |
tree | 7942be8ba2cb8f98d2c387536ad8f480ea94a314 /depot_gui.c | |
parent | ea075f78e04cc5675e890f82e181276ebc6b6f00 (diff) | |
download | openttd-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 'depot_gui.c')
-rw-r--r-- | depot_gui.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/depot_gui.c b/depot_gui.c index bf3472509..f7b4b9307 100644 --- a/depot_gui.c +++ b/depot_gui.c @@ -614,6 +614,8 @@ static void ResizeDepotButtons(Window *w) } } +void DepotSortList(Vehicle **v, uint16 length); + static void DepotWndProc(Window *w, WindowEvent *e) { switch (e->event) { @@ -637,6 +639,7 @@ static void DepotWndProc(Window *w, WindowEvent *e) &WP(w, depot_d).vehicle_list, &WP(w, depot_d).engine_list_length, &WP(w, depot_d).engine_count, &WP(w, depot_d).wagon_list, &WP(w, depot_d).wagon_list_length, &WP(w, depot_d).wagon_count); WP(w, depot_d).generate_list = false; + DepotSortList(WP(w, depot_d).vehicle_list, WP(w, depot_d).engine_count); #ifndef NDEBUG } else { /* Here we got a piece of code, that only checks if we got a different number of vehicles in the depot list and the number of vehicles actually being in the depot. |