Go to the documentation of this file.
10 #ifndef BLITTER_32BPP_ANIM_HPP
11 #define BLITTER_32BPP_ANIM_HPP
40 void SetPixel(
void *video,
int x,
int y, uint8 colour)
override;
41 void DrawLine(
void *video,
int x,
int y,
int x2,
int y2,
int screen_width,
int screen_height, uint8 colour,
int width,
int dash)
override;
42 void DrawRect(
void *video,
int width,
int height, uint8 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 int BufferSize(
int width,
int height)
override;
50 const char *
GetName()
override {
return "32bpp-anim"; }
59 return this->palette.
palette[index];
62 inline int ScreenToAnimOffset(
const uint32 *video)
64 int raw_offset = video - (
const uint32 *)_screen.dst_ptr;
65 if (_screen.pitch == this->anim_buf_pitch)
return raw_offset;
66 int lines = raw_offset / _screen.pitch;
67 int across = raw_offset % _screen.pitch;
Factory for the 32bpp blitter with animation.
void PostResize() override
Post resize event.
BlitterMode
The modes of blitting we can do.
How all blitters should look like.
The base factory, keeping track of all blitters.
uint16 * anim_buf
In this buffer we keep track of the 8bpp indexes so we can do palette animation.
void CopyFromBuffer(void *video, const void *src, int width, int height) override
Copy from a buffer to the screen.
Blitter * CreateInstance() override
Create an instance of this Blitter-class.
ZoomLevel
All zoom levels we know.
int anim_buf_pitch
The pitch of the animation buffer (width rounded up to 16 byte boundary).
int anim_buf_width
The width of the animation buffer.
void * anim_alloc
The raw allocated buffer, not necessarily aligned correctly.
int anim_buf_height
The height of the animation buffer.
void CopyToBuffer(const void *video, void *dst, int width, int height) override
Copy from the screen to a buffer.
Colour palette[256]
Current palette. Entry 0 has to be always fully transparent!
void DrawRect(void *video, int width, int height, uint8 colour) override
Make a single horizontal line in a single colour on the video-buffer.
int GetBytesPerPixel() override
Get how many bytes are needed to store a pixel.
Palette palette
The current palette.
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...
Structure to access the alpha, red, green, and blue channels from a 32 bit number.
BlitterFactory(const char *name, const char *description, bool usable=true)
Construct the blitter, and register it.
PaletteAnimation
Types of palette animation.
int BufferSize(int width, int height) override
Calculate how much memory there is needed for an image of this size in the video-buffer.
const char * GetName() override
Get the name of the blitter, the same as the Factory-instance returns.
uint32 PaletteID
The number of the palette.
The optimised 32 bpp blitter with palette animation.
void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash) override
Draw a line with a given colour.
Blitter::PaletteAnimation UsePaletteAnimation() override
Check if the blitter uses palette animation at all.
Palette _cur_palette
Current palette.
Parameters related to blitting.
void SetPixel(void *video, int x, int y, uint8 colour) override
Draw a pixel with a given colour on the video-buffer.
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override
Draw an image to the screen, given an amount of params defined above.
Colour LookupColourInPalette(uint index)
Look up the colour in the current palette.
Information about the currently used palette.
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.
The optimised 32 bpp blitter (without palette animation).
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override
Draw a colourtable to the screen.