Add: A 32 bpp blitter that uses the animation buffer from the video backend to speed up palette animation.
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user