14#include "../safeguards.h"
18 return (uint32_t *)video + x + y * _screen.pitch;
26void 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)
29 this->DrawLineGeneric(x, y, x2, y2, screen_width, screen_height, width, dash, [=](
int x,
int y) {
30 *((Colour *)video + x + y * _screen.pitch) = c;
39 Colour *dst = (Colour *)video;
40 for (
int i = width; i > 0; i--) {
44 video = (uint32_t *)video + _screen.pitch;
50 uint32_t *dst = (uint32_t *)video;
51 const uint32_t *usrc = (
const uint32_t *)src;
53 for (; height > 0; height--) {
54 memcpy(dst, usrc, width *
sizeof(uint32_t));
62 uint32_t *udst = (uint32_t *)dst;
63 const uint32_t *src = (
const uint32_t *)video;
65 for (; height > 0; height--) {
66 memcpy(udst, src, width *
sizeof(uint32_t));
74 uint32_t *udst = (uint32_t *)dst;
75 const uint32_t *src = (
const uint32_t *)video;
77 for (; height > 0; height--) {
78 memcpy(udst, src, width *
sizeof(uint32_t));
91 dst = (uint32_t *)video + left + (top + height - 1) * _screen.pitch;
92 src = dst - scroll_y * _screen.pitch;
109 for (
int h = height; h > 0; h--) {
110 memcpy(dst, src, width *
sizeof(uint32_t));
111 src -= _screen.pitch;
112 dst -= _screen.pitch;
116 dst = (uint32_t *)video + left + top * _screen.pitch;
117 src = dst - scroll_y * _screen.pitch;
135 for (
int h = height; h > 0; h--) {
136 memmove(dst, src, width *
sizeof(uint32_t));
137 src += _screen.pitch;
138 dst += _screen.pitch;
145 return sizeof(uint32_t) * width * height;
Base for all 32 bits blitters.
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.
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
Draw a line with a given colour.
void CopyToBuffer(const void *video, void *dst, int width, int height) override
Copy from the screen to a buffer.
void DrawRect(void *video, int width, int height, uint8_t colour) override
Make a single horizontal line in a single colour on the video-buffer.
static Colour LookupColourInPalette(uint index)
Look up the colour in the current palette.
Blitter::PaletteAnimation UsePaletteAnimation() override
Check if the blitter uses palette animation at all.
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 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 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 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 SetPixel(void *video, int x, int y, uint8_t colour) override
Draw a pixel with a given colour on the video-buffer.
PaletteAnimation
Types of palette animation.
@ None
No palette animation.
Common functionality for all blitter implementations.
Information about the currently used palette.