OpenTTD Source 20260531-master-g0e951f3528
livery.h File Reference

Functions/types related to livery colours. More...

#include "core/enum_type.hpp"
#include "company_type.h"
#include "gfx_type.h"

Go to the source code of this file.

Data Structures

struct  Livery
 Information about a particular livery. More...

Typedefs

using LiverySchemes = EnumBitSet<LiveryScheme, uint32_t, LiveryScheme::End>
 Bitset of LiveryScheme elements.

Enumerations

enum class  LiveryScheme : uint8_t {
  Begin = 0 , Default = 0 , Steam , Diesel ,
  Electric , Monorail , Maglev , DMU ,
  EMU , PassengerWagonSteam , PassengerWagonDiesel , PassengerWagonElectric ,
  PassengerWagonMonorail , PassengerWagonMaglev , FreightWagon , Bus ,
  Truck , PassengerShip , FreightShip , Helicopter ,
  SmallPlane , LargePlane , PassengerTram , FreightTram ,
  End
}
 List of different livery schemes. More...
enum class  LiveryClass : uint8_t {
  Other , Rail , Road , Ship ,
  Aircraft , GroupRail , GroupRoad , GroupShip ,
  GroupAircraft
}
 List of different livery classes, used only by the livery GUI. More...

Functions

void ResetCompanyLivery (Company *c)
 Reset the livery schemes to the company's primary colour.

Variables

static const uint8_t LIT_NONE = 0
 Don't show the liveries at all.
static const uint8_t LIT_COMPANY = 1
 Show the liveries of your own company.
static const uint8_t LIT_ALL = 2
 Show the liveries of all companies.

Detailed Description

Functions/types related to livery colours.

Definition in file livery.h.

Typedef Documentation

◆ LiverySchemes

Bitset of LiveryScheme elements.

Definition at line 65 of file livery.h.

Enumeration Type Documentation

◆ LiveryClass

enum class LiveryClass : uint8_t
strong

List of different livery classes, used only by the livery GUI.

Enumerator
Other 

General livery schemes.

Rail 

Rail livery schemes.

Road 

Road livery schemes.

Ship 

Ship livery schemes.

Aircraft 

Aircraft livery schemes.

GroupRail 

Rail group.

GroupRoad 

Road group.

GroupShip 

Ship group.

GroupAircraft 

Aircraft group.

Definition at line 68 of file livery.h.

◆ LiveryScheme

enum class LiveryScheme : uint8_t
strong

List of different livery schemes.

Enumerator
Begin 

Begin marker.

Default 

Default scheme.

Steam 

Steam engines.

Diesel 

Diesel engines.

Electric 

Electric engines.

Monorail 

Monorail engines.

Maglev 

Maglev engines.

DMU 

DMUs and their passenger wagons.

EMU 

EMUs and their passenger wagons.

PassengerWagonSteam 

Passenger wagons attached to steam engines.

PassengerWagonDiesel 

Passenger wagons attached to diesel engines.

PassengerWagonElectric 

Passenger wagons attached to electric engines.

PassengerWagonMonorail 

Passenger wagons attached to monorail engines.

PassengerWagonMaglev 

Passenger wagons attached to maglev engines.

FreightWagon 

Freight wagons.

Bus 

Buses.

Truck 

Trucks.

PassengerShip 

Passenger ships.

FreightShip 

Freight ships.

Helicopter 

Helicopters.

SmallPlane 

Small aeroplanes.

LargePlane 

Large aeroplanes.

PassengerTram 

Passenger trams.

FreightTram 

Freight trams.

End 

End marker.

Definition at line 22 of file livery.h.

Function Documentation

◆ ResetCompanyLivery()

void ResetCompanyLivery ( Company * c)

Reset the livery schemes to the company's primary colour.

This is used on loading games without livery information and on new company start up.

Parameters
cCompany to reset.

Definition at line 567 of file company_cmd.cpp.

References Begin, CompanyProperties::colour, and End.

Referenced by AfterLoadGame(), and DoStartupNewCompany().

Variable Documentation

◆ LIT_ALL

const uint8_t LIT_ALL = 2
static

Show the liveries of all companies.

Definition at line 19 of file livery.h.

Referenced by GetEngineLivery(), LiveryHelper(), and SelectCompanyLiveryWindow::OnInvalidateData().

◆ LIT_COMPANY

const uint8_t LIT_COMPANY = 1
static

Show the liveries of your own company.

Definition at line 18 of file livery.h.

Referenced by GetEngineLivery(), and SelectCompanyLiveryWindow::OnInvalidateData().

◆ LIT_NONE

const uint8_t LIT_NONE = 0
static

Don't show the liveries at all.

Definition at line 17 of file livery.h.