Blitter: Change DrawLine to be templated

This commit is contained in:
Jonathan G Rennison
2018-01-16 23:23:52 +00:00
parent cd68e9fac7
commit 0c2f49c08d
9 changed files with 163 additions and 140 deletions

View File

@@ -24,6 +24,14 @@ void Blitter_32bppBase::SetPixel(void *video, int x, int y, uint8 colour)
*((Colour *)video + x + y * _screen.pitch) = LookupColourInPalette(colour);
}
void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash)
{
const Colour c = LookupColourInPalette(colour);
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::SetLine(void *video, int x, int y, uint8 *colours, uint width)
{
Colour *dst = (Colour *)video + x + y * _screen.pitch;