OpenTTD Source 20251116-master-g21329071df
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 "core/enum_type.hpp"
14#include "company_type.h"
15#include "gfx_type.h"
16
17static const uint8_t LIT_NONE = 0;
18static const uint8_t LIT_COMPANY = 1;
19static const uint8_t LIT_ALL = 2;
20
22enum LiveryScheme : uint8_t {
23 LS_BEGIN = 0,
24 LS_DEFAULT = 0,
25
26 /* Rail vehicles */
27 LS_STEAM,
28 LS_DIESEL,
29 LS_ELECTRIC,
30 LS_MONORAIL,
31 LS_MAGLEV,
32 LS_DMU,
33 LS_EMU,
34 LS_PASSENGER_WAGON_STEAM,
35 LS_PASSENGER_WAGON_DIESEL,
36 LS_PASSENGER_WAGON_ELECTRIC,
37 LS_PASSENGER_WAGON_MONORAIL,
38 LS_PASSENGER_WAGON_MAGLEV,
39 LS_FREIGHT_WAGON,
40
41 /* Road vehicles */
42 LS_BUS,
43 LS_TRUCK,
44
45 /* Ships */
46 LS_PASSENGER_SHIP,
47 LS_FREIGHT_SHIP,
48
49 /* Aircraft */
50 LS_HELICOPTER,
51 LS_SMALL_PLANE,
52 LS_LARGE_PLANE,
53
54 /* Trams (appear on Road Vehicles tab) */
55 LS_PASSENGER_TRAM,
56 LS_FREIGHT_TRAM,
57
58 LS_END
59};
60
62
63
64enum LiveryClass : uint8_t {
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};
77
78
79struct Livery {
80 enum class Flag : uint8_t {
81 Primary = 0,
82 Secondary = 1,
83 };
84 using Flags = EnumBitSet<Flag, uint8_t>;
85
86 Flags in_use{};
87 Colours colour1 = COLOUR_BEGIN;
88 Colours colour2 = COLOUR_BEGIN;
89};
90
92
93#endif /* LIVERY_H */
Enum-as-bit-set wrapper.
Types related to companies.
Type (helpers) for enums.
#define DECLARE_ENUM_AS_ADDABLE(EnumType)
Operator that allows this enumeration to be added to any other enumeration.
#define DECLARE_INCREMENT_DECREMENT_OPERATORS(enum_type)
For some enums it is useful to have pre/post increment/decrement operators.
Definition enum_type.hpp:63
Types related to the graphics and/or input devices.
static const uint8_t LIT_ALL
Show the liveries of all companies.
Definition livery.h:19
LiveryScheme
List of different livery schemes.
Definition livery.h:22
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:18
static const uint8_t LIT_NONE
Don't show the liveries at all.
Definition livery.h:17
LiveryClass
List of different livery classes, used only by the livery GUI.
Definition livery.h:64
Information about a particular livery.
Definition livery.h:79