summaryrefslogtreecommitdiff
path: root/src/window_gui.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-11 14:23:45 +0000
committerrubidium <rubidium@openttd.org>2008-05-11 14:23:45 +0000
commit89a60ce249cf2d2babb58135ba67242e60bbcdaf (patch)
tree8e70266c44dd64a99df691b845962a790765964e /src/window_gui.h
parentaa0929351d32aeffc1e67bb1c9a8f8a4495e63c6 (diff)
downloadopenttd-89a60ce249cf2d2babb58135ba67242e60bbcdaf.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.h19
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 {