Merge tag '1.11.0-beta2' into jgrpp

# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release.yml
#	CMakeLists.txt
#	src/blitter/32bpp_optimized.cpp
#	src/debug.cpp
#	src/gfx.cpp
#	src/gfx_func.h
#	src/lang/czech.txt
#	src/lang/english.txt
#	src/lang/italian.txt
#	src/lang/swedish.txt
#	src/lang/ukrainian.txt
#	src/network/network_server.cpp
#	src/os/windows/crashlog_win.cpp
#	src/os/windows/win32.cpp
#	src/pathfinder/follow_track.hpp
#	src/screenshot.cpp
#	src/settings_type.h
#	src/spritecache.cpp
#	src/vehicle_gui.cpp
#	src/video/sdl2_v.cpp
#	src/video/video_driver.cpp
#	src/video/video_driver.hpp
#	src/video/win32_v.cpp
This commit is contained in:
Jonathan G Rennison
2021-03-02 11:59:03 +00:00
148 changed files with 19670 additions and 1452 deletions

View File

@@ -126,6 +126,18 @@ public:
return ((r * 13063) + (g * 25647) + (b * 4981)) / 65536;
}
/**
* Make a colour dark grey, for specialized 32bpp remapping.
* @param colour the colour to make dark.
* @return the new colour, now darker.
*/
static inline Colour MakeDark(Colour colour)
{
uint8 d = MakeDark(colour.r, colour.g, colour.b);
return Colour(d, d, d);
}
/**
* Make a colour grey - based.
* @param colour the colour to make grey.
@@ -156,6 +168,16 @@ public:
return ReallyAdjustBrightness(colour, brightness);
}
static inline uint8 GetColourBrightness(Colour colour)
{
uint8 rgb_max = std::max(colour.r, std::max(colour.g, colour.b));
/* Black pixel (8bpp or old 32bpp image), so use default value */
if (rgb_max == 0) rgb_max = DEFAULT_BRIGHTNESS;
return rgb_max;
}
};
#endif /* BLITTER_32BPP_BASE_HPP */