OpenTTD Source  20241120-master-g6d3adc6169
livery.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef LIVERY_H
11 #define LIVERY_H
12 
13 #include "company_type.h"
14 #include "gfx_type.h"
15 
16 static const uint8_t LIT_NONE = 0;
17 static const uint8_t LIT_COMPANY = 1;
18 static const uint8_t LIT_ALL = 2;
19 
21 enum LiveryScheme : uint8_t {
22  LS_BEGIN = 0,
23  LS_DEFAULT = 0,
24 
25  /* Rail vehicles */
26  LS_STEAM,
27  LS_DIESEL,
28  LS_ELECTRIC,
29  LS_MONORAIL,
30  LS_MAGLEV,
31  LS_DMU,
32  LS_EMU,
33  LS_PASSENGER_WAGON_STEAM,
34  LS_PASSENGER_WAGON_DIESEL,
35  LS_PASSENGER_WAGON_ELECTRIC,
36  LS_PASSENGER_WAGON_MONORAIL,
37  LS_PASSENGER_WAGON_MAGLEV,
38  LS_FREIGHT_WAGON,
39 
40  /* Road vehicles */
41  LS_BUS,
42  LS_TRUCK,
43 
44  /* Ships */
45  LS_PASSENGER_SHIP,
46  LS_FREIGHT_SHIP,
47 
48  /* Aircraft */
49  LS_HELICOPTER,
50  LS_SMALL_PLANE,
51  LS_LARGE_PLANE,
52 
53  /* Trams (appear on Road Vehicles tab) */
54  LS_PASSENGER_TRAM,
55  LS_FREIGHT_TRAM,
56 
57  LS_END
58 };
59 
61 
62 
63 enum LiveryClass : uint8_t {
64  LC_OTHER,
65  LC_RAIL,
66  LC_ROAD,
67  LC_SHIP,
68  LC_AIRCRAFT,
69  LC_GROUP_RAIL,
70  LC_GROUP_ROAD,
71  LC_GROUP_SHIP,
72  LC_GROUP_AIRCRAFT,
73  LC_END
74 };
76 
77 
78 struct Livery {
79  uint8_t in_use;
80  Colours colour1;
81  Colours colour2;
82 };
83 
85 
86 #endif /* LIVERY_H */
Types related to companies.
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:18
#define DECLARE_ENUM_AS_ADDABLE(EnumType)
Operator that allows this enumeration to be added to any other enumeration.
Definition: enum_type.hpp:45
Types related to the graphics and/or input devices.
static const uint8_t LIT_ALL
Show the liveries of all companies.
Definition: livery.h:18
LiveryScheme
List of different livery schemes.
Definition: livery.h:21
void ResetCompanyLivery(Company *c)
Reset the livery schemes to the company's primary colour.
static const uint8_t LIT_COMPANY
Show the liveries of your own company.
Definition: livery.h:17
static const uint8_t LIT_NONE
Don't show the liveries at all.
Definition: livery.h:16
LiveryClass
List of different livery classes, used only by the livery GUI.
Definition: livery.h:63
Information about a particular livery.
Definition: livery.h:78
Colours colour2
Second colour, for vehicles with 2CC support.
Definition: livery.h:81
Colours colour1
First colour, for all vehicles.
Definition: livery.h:80
uint8_t in_use
Bit 0 set if this livery should override the default livery first colour, Bit 1 for the second colour...
Definition: livery.h:79