OpenTTD Source: src/livery.h Source File

OpenTTD Source 1.11.0-RC1

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
15 static const byte LIT_NONE = 0;
16 static const byte LIT_COMPANY = 1;
17 static const byte LIT_ALL = 2;
18
20 enum LiveryScheme {
21 LS_BEGIN = 0,
22 LS_DEFAULT = 0,
23
24 /* Rail vehicles */
25 LS_STEAM,
26 LS_DIESEL,
27 LS_ELECTRIC,
28 LS_MONORAIL,
29 LS_MAGLEV,
30 LS_DMU,
31 LS_EMU,
32 LS_PASSENGER_WAGON_STEAM,
33 LS_PASSENGER_WAGON_DIESEL,
34 LS_PASSENGER_WAGON_ELECTRIC,
35 LS_PASSENGER_WAGON_MONORAIL,
36 LS_PASSENGER_WAGON_MAGLEV,
37 LS_FREIGHT_WAGON,
38
39 /* Road vehicles */
40 LS_BUS,
41 LS_TRUCK,
42
43 /* Ships */
44 LS_PASSENGER_SHIP,
45 LS_FREIGHT_SHIP,
46
47 /* Aircraft */
48 LS_HELICOPTER,
49 LS_SMALL_PLANE,
50 LS_LARGE_PLANE,
51
52 /* Trams (appear on Road Vehicles tab) */
53 LS_PASSENGER_TRAM,
54 LS_FREIGHT_TRAM,
55
56 LS_END
57 };
58
59 DECLARE_POSTFIX_INCREMENT(LiveryScheme)
61 template <> struct EnumPropsT<LiveryScheme> : MakeEnumPropsT<LiveryScheme, byte, LS_BEGIN, LS_END, LS_END, 8> {};
62
64 enum LiveryClass {
65 LC_OTHER,
66 LC_RAIL,
67 LC_ROAD,
68 LC_SHIP,
69 LC_AIRCRAFT,
70 LC_GROUP_RAIL,
71 LC_GROUP_ROAD,
72 LC_GROUP_SHIP,
73 LC_GROUP_AIRCRAFT,
74 LC_END
75 };
76
78 struct Livery {
79 byte in_use;
80 byte colour1;
81 byte colour2;
82 };
83
84 void ResetCompanyLivery(Company *c);
85
86 #endif /* LIVERY_H */
DECLARE_POSTFIX_INCREMENT
#define DECLARE_POSTFIX_INCREMENT(enum_type)
Some enums need to have allowed incrementing (i.e.
Definition: enum_type.hpp:14
EnumPropsT
Informative template class exposing basic enumeration properties used by several other templates belo...
Definition: enum_type.hpp:48
LIT_ALL
static const byte LIT_ALL
Show the liveries of all companies.
Definition: livery.h:17
LIT_COMPANY
static const byte LIT_COMPANY
Show the liveries of your own company.
Definition: livery.h:16
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
LIT_NONE
static const byte LIT_NONE
Don't show the liveries at all.
Definition: livery.h:15
ResetCompanyLivery
void ResetCompanyLivery(Company *c)
Reset the livery schemes to the company's primary colour.
Definition: company_cmd.cpp:515
MakeEnumPropsT
Helper template class that makes basic properties of given enumeration type visible from outsize.
Definition: enum_type.hpp:62
LiveryScheme
LiveryScheme
List of different livery schemes.
Definition: livery.h:20
LiveryClass
LiveryClass
List of different livery classes, used only by the livery GUI.
Definition: livery.h:64
Company
Definition: company_base.h:110
Livery
Information about a particular livery.
Definition: livery.h:78
company_type.h
Livery::colour2
byte colour2
Second colour, for vehicles with 2CC support.
Definition: livery.h:81
Livery::colour1
byte colour1
First colour, for all vehicles.
Definition: livery.h:80