Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
This commit is contained in:
@@ -18,11 +18,11 @@
|
||||
/** Base for all 32bpp blitters. */
|
||||
class Blitter_32bppBase : public Blitter {
|
||||
public:
|
||||
uint8 GetScreenDepth() override { return 32; }
|
||||
uint8_t GetScreenDepth() override { return 32; }
|
||||
void *MoveTo(void *video, int x, int y) override;
|
||||
void SetPixel(void *video, int x, int y, uint8 colour) override;
|
||||
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override;
|
||||
void DrawRect(void *video, int width, int height, uint8 colour) override;
|
||||
void SetPixel(void *video, int x, int y, uint8_t colour) override;
|
||||
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8_t colour, int width, int dash) override;
|
||||
void DrawRect(void *video, int width, int height, uint8_t colour) override;
|
||||
void CopyFromBuffer(void *video, const void *src, int width, int height) override;
|
||||
void CopyToBuffer(const void *video, void *dst, int width, int height) override;
|
||||
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override;
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
* @param b blue component
|
||||
* @return the brightness value of the new colour, now dark grey.
|
||||
*/
|
||||
static inline uint8 MakeDark(uint8 r, uint8 g, uint8 b)
|
||||
static inline uint8_t MakeDark(uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
/* Magic-numbers are ~66% of those used in MakeGrey() */
|
||||
return ((r * 13063) + (g * 25647) + (b * 4981)) / 65536;
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
*/
|
||||
static inline Colour MakeDark(Colour colour)
|
||||
{
|
||||
uint8 d = MakeDark(colour.r, colour.g, colour.b);
|
||||
uint8_t d = MakeDark(colour.r, colour.g, colour.b);
|
||||
|
||||
return Colour(d, d, d);
|
||||
}
|
||||
@@ -157,9 +157,9 @@ public:
|
||||
|
||||
static const int DEFAULT_BRIGHTNESS = 128;
|
||||
|
||||
static Colour ReallyAdjustBrightness(Colour colour, uint8 brightness);
|
||||
static Colour ReallyAdjustBrightness(Colour colour, uint8_t brightness);
|
||||
|
||||
static inline Colour AdjustBrightness(Colour colour, uint8 brightness)
|
||||
static inline Colour AdjustBrightness(Colour colour, uint8_t brightness)
|
||||
{
|
||||
/* Shortcut for normal brightness */
|
||||
if (brightness == DEFAULT_BRIGHTNESS) return colour;
|
||||
@@ -167,9 +167,9 @@ public:
|
||||
return ReallyAdjustBrightness(colour, brightness);
|
||||
}
|
||||
|
||||
static inline uint8 GetColourBrightness(Colour colour)
|
||||
static inline uint8_t GetColourBrightness(Colour colour)
|
||||
{
|
||||
uint8 rgb_max = std::max(colour.r, std::max(colour.g, colour.b));
|
||||
uint8_t 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;
|
||||
|
Reference in New Issue
Block a user