1 #ifndef VEHICLE_GUI_H |
1 #ifndef VEHICLE_GUI_H |
2 #define VEHICLE_GUI_H |
2 #define VEHICLE_GUI_H |
|
3 |
|
4 #include "vehicle.h" |
3 |
5 |
4 struct vehiclelist_d; |
6 struct vehiclelist_d; |
5 |
7 |
6 void DrawVehicleProfitButton(Vehicle *v, int x, int y); |
8 void DrawVehicleProfitButton(Vehicle *v, int x, int y); |
7 void InitializeVehiclesGuiList(void); |
9 void InitializeVehiclesGuiList(void); |
8 |
10 |
9 /* sorter stuff */ |
11 /* sorter stuff */ |
10 void RebuildVehicleLists(void); |
12 void RebuildVehicleLists(void); |
11 void ResortVehicleLists(void); |
13 void ResortVehicleLists(void); |
12 |
14 |
13 void BuildVehicleList(struct vehiclelist_d *vl, int type, int owner, int station); |
15 void BuildVehicleList(struct vehiclelist_d *vl, VehicleType type, int owner, int station); |
14 void SortVehicleList(struct vehiclelist_d *vl); |
16 void SortVehicleList(struct vehiclelist_d *vl); |
15 |
17 |
16 typedef struct SortStruct { // store owner through sorting process |
|
17 uint32 index; |
|
18 byte owner; |
|
19 } SortStruct; |
|
20 |
|
21 int CDECL GeneralOwnerSorter(const void *a, const void *b); |
18 int CDECL GeneralOwnerSorter(const void *a, const void *b); |
22 void VehicleSorter(SortStruct *firstelement, uint32 n, uint16 size); |
|
23 VARDEF uint32 _internal_name_sorter_id; // internal StringID for default vehicle-names |
19 VARDEF uint32 _internal_name_sorter_id; // internal StringID for default vehicle-names |
24 VARDEF uint32 _last_vehicle_idx; // cached index to hopefully speed up name-sorting |
20 VARDEF uint32 _last_vehicle_idx; // cached index to hopefully speed up name-sorting |
25 VARDEF bool _internal_sort_order; // descending/ascending |
21 VARDEF bool _internal_sort_order; // descending/ascending |
26 |
22 |
27 #define PERIODIC_RESORT_DAYS 10 |
23 #define PERIODIC_RESORT_DAYS 10 |