diff options
author | Darkvater <Darkvater@openttd.org> | 2006-09-03 23:27:38 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2006-09-03 23:27:38 +0000 |
commit | eb9a2dd3f602dce13a74489f6cf2672cb4c57472 (patch) | |
tree | d68e3bad2ab41ec5f072e13cd16cb748aa8653f5 /window.h | |
parent | 718255a7003d8164cee09b061b3a3bd2e29c4445 (diff) | |
download | openttd-eb9a2dd3f602dce13a74489f6cf2672cb4c57472.tar.xz |
(svn r6372) -Codechange: static, unneeded decleration in headers, superfluous header includes
-Codechange: Unify the Sorting struct both for vehicle-lists and network-lists.
Diffstat (limited to 'window.h')
-rw-r--r-- | window.h | 24 |
1 files changed, 10 insertions, 14 deletions
@@ -449,26 +449,22 @@ typedef struct { } scroller_d; assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(scroller_d)); -typedef enum VehicleListFlags { +typedef enum SortListFlags { VL_DESC = 0x01, // sort descending or ascending VL_RESORT = 0x02, // instruct the code to resort the list in the next loop VL_REBUILD = 0x04 // create sort-listing to use for qsort and friends -} VehicleListFlags; +} SortListFlags; -typedef struct vehiclelist_d { - const Vehicle** sort_list; - uint16 list_length; - byte sort_type; - VehicleListFlags flags; - uint16 resort_timer; -} vehiclelist_d; -assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vehiclelist_d)); +typedef struct Listing { + bool order; // Ascending/descending + byte criteria; // Sorting criteria +} Listing; typedef struct list_d { - uint16 list_length; // length of the list being sorted - byte sort_type; // what criteria to sort on - VehicleListFlags flags;// used to control sorting/resorting/etc. - uint16 resort_timer; // resort list after a given amount of ticks if set + uint16 list_length; // length of the list being sorted + byte sort_type; // what criteria to sort on + SortListFlags flags; // used to control sorting/resorting/etc. + uint16 resort_timer; // resort list after a given amount of ticks if set } list_d; assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(list_d)); |