OpenTTD Source: src/livery.h Source File

OpenTTD Source 14.0-RC3

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 byte LIT_NONE = 0;
17 static const byte LIT_COMPANY = 1;
18 static const byte LIT_ALL = 2;
19
21 enum LiveryScheme : byte {
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
60 DECLARE_POSTFIX_INCREMENT(LiveryScheme)
61
62
63 enum LiveryClass : byte {
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 };
75 DECLARE_ENUM_AS_ADDABLE(LiveryClass)
76
77
78 struct Livery {
79 byte in_use;
80 Colours colour1;
81 Colours colour2;
82 };
83
84 void ResetCompanyLivery(Company *c);
85
86 #endif /* LIVERY_H */
LiveryScheme
LiveryScheme
List of different livery schemes.
Definition: livery.h:21
DECLARE_POSTFIX_INCREMENT
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:14
LIT_ALL
static const byte LIT_ALL
Show the liveries of all companies.
Definition: livery.h:18
LIT_COMPANY
static const byte LIT_COMPANY
Show the liveries of your own company.
Definition: livery.h:17
Livery::in_use
byte 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
DECLARE_ENUM_AS_ADDABLE
#define DECLARE_ENUM_AS_ADDABLE(EnumType)
Operator that allows this enumeration to be added to any other enumeration.
Definition: enum_type.hpp:41
LiveryClass
LiveryClass
List of different livery classes, used only by the livery GUI.
Definition: livery.h:63
Livery::colour1
Colours colour1
First colour, for all vehicles.
Definition: livery.h:80
LIT_NONE
static const byte LIT_NONE
Don't show the liveries at all.
Definition: livery.h:16
ResetCompanyLivery
void ResetCompanyLivery(Company *c)
Reset the livery schemes to the company's primary colour.
Definition: company_cmd.cpp:559
gfx_type.h
Company
Definition: company_base.h:129
Livery::colour2
Colours colour2
Second colour, for vehicles with 2CC support.
Definition: livery.h:81
Livery
Information about a particular livery.
Definition: livery.h:78
company_type.h