Add: A 32 bpp blitter that uses the animation buffer from the video backend to speed up palette animation.

This commit is contained in:
Michael Lutz
2021-01-16 16:43:44 +01:00
parent ae7c63cc35
commit 94d8acb7d0
7 changed files with 607 additions and 3 deletions

View File

@@ -124,6 +124,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.
@@ -154,6 +166,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 */