10#ifndef BLITTER_40BPP_OPTIMIZED_HPP
11#define BLITTER_40BPP_OPTIMIZED_HPP
15#include "../video/video_driver.hpp"
23 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;
24 void CopyFromBuffer(
void *video,
const void *src,
int width,
int height)
override;
25 void CopyToBuffer(
const void *video,
void *dst,
int width,
int height)
override;
26 void CopyImageToBuffer(
const void *video,
void *dst,
int width,
int height,
int dst_pitch)
override;
27 void ScrollBuffer(
void *video,
int &left,
int &top,
int &width,
int &height,
int scroll_x,
int scroll_y)
override;
31 size_t BufferSize(uint width, uint height)
override;
35 std::string_view
GetName()
override {
return "40bpp-anim"; }
40 static inline Colour RealizeBlendedColour(uint8_t anim, Colour c)
57 std::unique_ptr<Blitter>
CreateInstance()
override {
return std::make_unique<Blitter_40bppAnim>(); }
Optimized 32 bpp blitter.
BlitterMode
The modes of blitting we can do.
The base factory, keeping track of all blitters.
static Colour LookupColourInPalette(uint index)
Look up the colour in the current palette.
The optimised 32 bpp blitter (without palette animation).
The optimized 40 bpp blitter (for OpenGL video driver).
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.
Sprite * Encode(SpriteType sprite_type, const SpriteLoader::SpriteCollection &sprite, SpriteAllocator &allocator) override
Convert a sprite from the loader to our own format.
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.
bool NeedsAnimationBuffer() override
Does this blitter require a separate animation buffer from the video backend?
Blitter::PaletteAnimation UsePaletteAnimation() override
Check if the blitter uses palette animation at all.
std::string_view GetName() override
Get the name of the blitter, the same as the Factory-instance returns.
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 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 CopyFromBuffer(void *video, const void *src, int width, int height) override
Copy from a buffer to the screen.
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 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
Draws a sprite to a (screen) buffer.
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override
Draw a colourtable to the screen.
void SetPixel(void *video, int x, int y, PixelColour colour) override
Draw a pixel with a given colour on the video-buffer.
PaletteAnimation
Types of palette animation.
Factory for the 40 bpp animated blitter (for OpenGL).
std::unique_ptr< Blitter > CreateInstance() override
Create an instance of this Blitter-class.
bool IsUsable() const override
Is the blitter usable with the current drivers and hardware config?
Interface for something that can allocate memory for a sprite.
virtual bool HasAnimBuffer()
Does this video driver support a separate animation buffer in addition to the colour buffer?
static VideoDriver * GetInstance()
Get the currently active instance of the video driver.
SpriteType
Types of sprites that might be loaded.
uint32_t PaletteID
The number of the palette.
static uint8_t GetColourBrightness(Colour colour)
Get the brightness of a colour.
Parameters related to blitting.
Colour for pixel/line drawing.
Data structure describing a sprite.
ZoomLevel
All zoom levels we know.