12 #include "../stdafx.h" 13 #include "../gfx_func.h" 17 #include "../safeguards.h" 21 const uint8 *ctab = GetNonSprite(pal,
ST_RECOLOUR) + 1;
24 for (
int i = 0; i != width; i++) *((uint8 *)dst + i) = ctab[((uint8 *)dst)[i]];
25 dst = (uint8 *)dst + _screen.pitch;
31 return (uint8 *)video + x + y * _screen.pitch;
36 *((uint8 *)video + x + y * _screen.pitch) = colour;
39 void Blitter_8bppBase::DrawLine(
void *video,
int x,
int y,
int x2,
int y2,
int screen_width,
int screen_height, uint8 colour,
int width,
int dash)
41 this->DrawLineGeneric(x, y, x2, y2, screen_width, screen_height, width, dash, [=](
int x,
int y) {
42 *((uint8 *)video + x + y * _screen.pitch) = colour;
49 memset(video, colour, width);
50 video = (uint8 *)video + _screen.pitch;
56 uint8 *dst = (uint8 *)video;
57 const uint8 *usrc = (
const uint8 *)src;
59 for (; height > 0; height--) {
60 memcpy(dst, usrc, width *
sizeof(uint8));
68 uint8 *udst = (uint8 *)dst;
69 const uint8 *src = (
const uint8 *)video;
71 for (; height > 0; height--) {
72 memcpy(udst, src, width *
sizeof(uint8));
80 uint8 *udst = (uint8 *)dst;
81 const uint8 *src = (
const uint8 *)video;
83 for (; height > 0; height--) {
84 memcpy(udst, src, width *
sizeof(uint8));
97 dst = (uint8 *)video + left + (top + height - 1) * _screen.pitch;
98 src = dst - scroll_y * _screen.pitch;
115 for (
int h = height; h > 0; h--) {
116 memcpy(dst, src, width *
sizeof(uint8));
117 src -= _screen.pitch;
118 dst -= _screen.pitch;
122 dst = (uint8 *)video + left + top * _screen.pitch;
123 src = dst - scroll_y * _screen.pitch;
141 for (
int h = height; h > 0; h--) {
142 memmove(dst, src, width *
sizeof(uint8));
143 src += _screen.pitch;
144 dst += _screen.pitch;
151 return width * height;
void DrawRect(void *video, int width, int height, uint8 colour)
Make a single horizontal line in a single colour on the video-buffer.
uint32 PaletteID
The number of the palette.
Information about the currently used palette.
void SetPixel(void *video, int x, int y, uint8 colour)
Draw a pixel with a given colour on the video-buffer.
void * MoveTo(void *video, int x, int y)
Move the destination pointer the requested amount x and y, keeping in mind any pitch and bpp of the r...
Palette animation should be done by video backend (8bpp only!)
void PaletteAnimate(const Palette &palette)
Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to...
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal)
Draw a colourtable to the screen.
Common functionality for all blitter implementations.
Base for all 8 bpp blitters.
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash)
Draw a line with a given colour.
void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y)
Scroll the videobuffer some 'x' and 'y' value.
void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch)
Copy from the screen to a buffer in a palette format for 8bpp and RGBA format for 32bpp...
void CopyFromBuffer(void *video, const void *src, int width, int height)
Copy from a buffer to the screen.
Blitter::PaletteAnimation UsePaletteAnimation()
Check if the blitter uses palette animation at all.
void CopyToBuffer(const void *video, void *dst, int width, int height)
Copy from the screen to a buffer.
PaletteAnimation
Types of palette animation.
int BufferSize(int width, int height)
Calculate how much memory there is needed for an image of this size in the video-buffer.