Codechange: Store Colours in Colours type. (#11625)

This reduces casts, some magic numbers, and introduces a bit of type-safety.
This commit is contained in:
Peter Nelson
2024-01-21 13:23:04 +00:00
committed by GitHub
parent 0841978304
commit c0ab436077
21 changed files with 50 additions and 41 deletions

View File

@@ -11,6 +11,7 @@
#define LIVERY_H
#include "company_type.h"
#include "gfx_type.h"
static const byte LIT_NONE = 0; ///< Don't show the liveries at all
static const byte LIT_COMPANY = 1; ///< Show the liveries of your own company
@@ -76,8 +77,8 @@ DECLARE_ENUM_AS_ADDABLE(LiveryClass)
/** Information about a particular livery. */
struct Livery {
byte in_use; ///< Bit 0 set if this livery should override the default livery first colour, Bit 1 for the second colour.
byte colour1; ///< First colour, for all vehicles.
byte colour2; ///< Second colour, for vehicles with 2CC support.
Colours colour1; ///< First colour, for all vehicles.
Colours colour2; ///< Second colour, for vehicles with 2CC support.
};
void ResetCompanyLivery(Company *c);