10#ifndef BLITTER_32BPP_ANIM_HPP
11#define BLITTER_32BPP_ANIM_HPP
40 void SetPixel(
void *video,
int x,
int y, uint8_t colour)
override;
41 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;
42 void DrawRect(
void *video,
int width,
int height, uint8_t colour)
override;
43 void CopyFromBuffer(
void *video,
const void *src,
int width,
int height)
override;
44 void CopyToBuffer(
const void *video,
void *dst,
int width,
int height)
override;
45 void ScrollBuffer(
void *video,
int &left,
int &top,
int &width,
int &height,
int scroll_x,
int scroll_y)
override;
46 size_t BufferSize(uint width, uint height)
override;
50 std::string_view
GetName()
override {
return "32bpp-anim"; }
58 return this->palette.
palette[index];
61 inline int ScreenToAnimOffset(
const uint32_t *video)
63 int raw_offset = video - (
const uint32_t *)_screen.dst_ptr;
64 if (_screen.pitch == this->anim_buf_pitch)
return raw_offset;
65 int lines = raw_offset / _screen.pitch;
66 int across = raw_offset % _screen.pitch;
Optimized 32 bpp blitter.
BlitterMode
The modes of blitting we can do.
The base factory, keeping track of all blitters.
The optimised 32 bpp blitter with palette animation.
void CopyFromBuffer(void *video, const void *src, int width, int height) override
Copy from a buffer to the screen.
Palette palette
The current palette.
Blitter::PaletteAnimation UsePaletteAnimation() override
Check if the blitter uses palette animation at all.
void * anim_alloc
The raw allocated buffer, not necessarily aligned correctly.
int anim_buf_width
The width of the animation buffer.
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.
Colour LookupColourInPalette(uint index)
Look up the colour in the current palette.
std::string_view GetName() override
Get the name of the blitter, the same as the Factory-instance returns.
void SetPixel(void *video, int x, int y, uint8_t colour) override
Draw a pixel with a given colour on the video-buffer.
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override
Draw a colourtable to the screen.
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.
uint16_t * anim_buf
In this buffer we keep track of the 8bpp indexes so we can do palette animation.
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.
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 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 PostResize() override
Post resize event.
void CopyToBuffer(const void *video, void *dst, int width, int height) override
Copy from the screen to a buffer.
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override
Draw an image to the screen, given an amount of params defined above.
int anim_buf_height
The height of the animation buffer.
int anim_buf_pitch
The pitch of the animation buffer (width rounded up to 16 byte boundary).
The optimised 32 bpp blitter (without palette animation).
How all blitters should look like.
PaletteAnimation
Types of palette animation.
Factory for the 32bpp blitter with animation.
Blitter * CreateInstance() override
Create an instance of this Blitter-class.
Palette _cur_palette
Current palette.
uint32_t PaletteID
The number of the palette.
Parameters related to blitting.
Information about the currently used palette.
Colour palette[256]
Current palette. Entry 0 has to be always fully transparent!
Structure to access the alpha, red, green, and blue channels from a 32 bit number.
ZoomLevel
All zoom levels we know.