Merge branch 'master' into jgrpp

# Conflicts:
#	CMakeLists.txt
#	bin/ai/CMakeLists.txt
#	bin/game/CMakeLists.txt
#	src/ai/ai_info.cpp
#	src/company_base.h
#	src/economy.cpp
#	src/game/game_info.cpp
#	src/gfx_type.h
#	src/linkgraph/linkgraph_gui.cpp
#	src/palette.cpp
#	src/palette_func.h
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/ship_cmd.cpp
#	src/train_cmd.cpp
#	src/vehicle_base.h
#	src/window.cpp
#	src/window_func.h
This commit is contained in:
Jonathan G Rennison
2024-02-26 18:19:34 +00:00
115 changed files with 3467 additions and 2164 deletions

View File

@@ -10,6 +10,7 @@
#ifndef PALETTE_FUNC_H
#define PALETTE_FUNC_H
#include "core/enum_type.hpp"
#include "gfx_type.h"
extern Palette _cur_palette; ///< Current palette
@@ -36,13 +37,25 @@ inline bool IsValidColours(Colours colours)
TextColour GetContrastColour(uint8_t background, uint8_t threshold = 128);
/**
* All 16 colour gradients
* 8 colours per gradient from darkest (0) to lightest (7)
*/
extern byte _colour_gradient[COLOUR_END][8];
extern byte _colour_value[COLOUR_END];
enum ColourShade : uint8_t {
SHADE_BEGIN = 0,
SHADE_DARKEST = SHADE_BEGIN,
SHADE_DARKER,
SHADE_DARK,
SHADE_NORMAL,
SHADE_LIGHT,
SHADE_LIGHTER,
SHADE_LIGHTEST,
SHADE_LIGHTEREST,
SHADE_END,
};
DECLARE_POSTFIX_INCREMENT(ColourShade)
byte GetColourGradient(Colours colour, ColourShade shade);
void SetColourGradient(Colours colour, ColourShade shade, byte palette_colour);
/**
* Return the colour for a particular greyscale level.
* @param level Intensity, 0 = black, 15 = white