Codechange: Add distinct type to hold pixel drawing colour. (#14457)

This is used for individual pixels as well as line drawing.
This commit is contained in:
Peter Nelson
2025-07-20 22:57:55 +01:00
committed by GitHub
parent 821784004d
commit 8e2df7809b
49 changed files with 246 additions and 234 deletions
+6 -6
View File
@@ -18,22 +18,22 @@ void *Blitter_32bppBase::MoveTo(void *video, int x, int y)
return (uint32_t *)video + x + y * _screen.pitch;
}
void Blitter_32bppBase::SetPixel(void *video, int x, int y, uint8_t colour)
void Blitter_32bppBase::SetPixel(void *video, int x, int y, PixelColour colour)
{
*((Colour *)video + x + y * _screen.pitch) = LookupColourInPalette(colour);
*((Colour *)video + x + y * _screen.pitch) = LookupColourInPalette(colour.p);
}
void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8_t colour, int width, int dash)
void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, PixelColour colour, int width, int dash)
{
const Colour c = LookupColourInPalette(colour);
const Colour c = LookupColourInPalette(colour.p);
this->DrawLineGeneric(x, y, x2, y2, screen_width, screen_height, width, dash, [=](int x, int y) {
*((Colour *)video + x + y * _screen.pitch) = c;
});
}
void Blitter_32bppBase::DrawRect(void *video, int width, int height, uint8_t colour)
void Blitter_32bppBase::DrawRect(void *video, int width, int height, PixelColour colour)
{
Colour colour32 = LookupColourInPalette(colour);
Colour colour32 = LookupColourInPalette(colour.p);
do {
Colour *dst = (Colour *)video;