23 for (
int i = 0; i != width; i++) *((uint8_t *)dst + i) = ctab[((uint8_t *)dst)[i]];
24 dst = (uint8_t *)dst + _screen.pitch;
30 return (uint8_t *)video + x + y * _screen.pitch;
35 *((uint8_t *)video + x + y * _screen.pitch) = colour.
p;
40 this->DrawLineGeneric(x, y, x2, y2, screen_width, screen_height, width, dash, [=](
int x,
int y) {
41 *((uint8_t *)video + x + y * _screen.pitch) = colour.
p;
47 std::byte *p =
static_cast<std::byte *
>(video);
49 std::fill_n(p, width,
static_cast<std::byte
>(colour.
p));
56 uint8_t *dst = (uint8_t *)video;
57 const uint8_t *usrc = (
const uint8_t *)src;
59 for (; height > 0; height--) {
60 std::copy_n(usrc, width, dst);
68 uint8_t *udst = (uint8_t *)dst;
69 const uint8_t *src = (
const uint8_t *)video;
71 for (; height > 0; height--) {
72 std::copy_n(src, width, udst);
80 uint8_t *udst = (uint8_t *)dst;
81 const uint8_t *src = (
const uint8_t *)video;
83 for (; height > 0; height--) {
84 std::copy_n(src, width, udst);
97 dst = (uint8_t *)video + left + (top + height - 1) * _screen.pitch;
98 src = dst - scroll_y * _screen.pitch;
115 Blitter::MovePixels(src, dst, width, height, -_screen.pitch);
118 dst = (uint8_t *)video + left + top * _screen.pitch;
119 src = dst - scroll_y * _screen.pitch;
135 Blitter::MovePixels(src, dst, width, height, _screen.pitch);
141 return static_cast<size_t>(width) * height;
Base for all 8 bpp blitters.
void SetPixel(void *video, int x, int y, PixelColour colour) override
Draw a pixel with a given colour on the video-buffer.
void DrawRect(void *video, int width, int height, PixelColour colour) override
Make a single horizontal line in a single colour on the video-buffer.
void CopyFromBuffer(void *video, const void *src, int width, int height) override
Copy from a buffer to the screen.
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) override
Scroll the videobuffer some 'x' and 'y' value.
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override
Draw a colourtable to the screen.
void PaletteAnimate(const Palette &palette) override
Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to...
void CopyToBuffer(const void *video, void *dst, int width, int height) override
Copy from the screen to a buffer.
size_t BufferSize(uint width, uint height) override
Calculate how much memory there is needed for an image of this size in the video-buffer.
Blitter::PaletteAnimation UsePaletteAnimation() override
Check if the blitter uses palette animation at all.
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch) override
Copy from the screen to a buffer in a palette format for 8bpp and RGBA format for 32bpp.
void * MoveTo(void *video, int x, int y) override
Move the destination pointer the requested amount x and y, keeping in mind any pitch and bpp of the r...
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, PixelColour colour, int width, int dash) override
Draw a line with a given colour.
PaletteAnimation
Types of palette animation.
@ VideoBackend
Palette animation should be done by video backend (8bpp only!).
Common functionality for all blitter implementations.
Functions related to the gfx engine.
@ Recolour
Recolour sprite.
uint32_t PaletteID
The number of the palette.
A number of safeguards to prevent using unsafe methods.
Functions to cache sprites in memory.
Definition of base types and functions in a cross-platform compatible way.
Information about the currently used palette.
Colour for pixel/line drawing.