diff options
author | rubidium <rubidium@openttd.org> | 2008-05-11 14:23:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-11 14:23:45 +0000 |
commit | 75e3792aa34785a30e97b2aca97f527baef948dc (patch) | |
tree | 8e70266c44dd64a99df691b845962a790765964e /src/window_gui.h | |
parent | 568464aa96c04511e6f3d2af39bed2fba2b98697 (diff) | |
download | openttd-75e3792aa34785a30e97b2aca97f527baef948dc.tar.xz |
(svn r13045) -Codechange: make list_d (now GUIList) more generic and uniform.
Diffstat (limited to 'src/window_gui.h')
-rw-r--r-- | src/window_gui.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/window_gui.h b/src/window_gui.h index 98431ebac..a647cb8c6 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -557,7 +557,6 @@ enum SortListFlags { VL_REBUILD = 1 << 2, ///< create sort-listing to use for qsort and friends VL_END = 1 << 3, }; - DECLARE_ENUM_AS_BIT_SET(SortListFlags); struct Listing { @@ -565,22 +564,14 @@ struct Listing { byte criteria; ///< Sorting criteria }; -struct list_d { - uint16 list_length; ///< length of the list being sorted - byte sort_type; ///< what criteria to sort on +template <typename T> +struct GUIList { + T* sort_list; ///< The items to sort. SortListFlags flags; ///< used to control sorting/resorting/etc. + uint16 list_length; ///< length of the list being sorted uint16 resort_timer; ///< resort list after a given amount of ticks if set + byte sort_type; ///< what criteria to sort on }; -assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(list_d)); - -struct vehiclelist_d { - const Vehicle** sort_list; // List of vehicles (sorted) - Listing *_sorting; // pointer to the appropiate subcategory of _sorting - uint16 length_of_sort_list; // Keeps track of how many vehicle pointers sort list got space for - VehicleType vehicle_type; // The vehicle type that is sorted - list_d l; // General list struct -}; -assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vehiclelist_d)); /****************** THESE ARE NOT WIDGET TYPES!!!!! *******************/ enum WindowWidgetBehaviours { |