OpenTTD Source
1.11.0-beta2
|
12 #ifndef BLITTER_40BPP_OPTIMIZED_HPP
13 #define BLITTER_40BPP_OPTIMIZED_HPP
17 #include "../video/video_driver.hpp"
24 void SetPixel(
void *video,
int x,
int y, uint8 colour)
override;
25 void DrawRect(
void *video,
int width,
int height, uint8 colour)
override;
26 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;
27 void CopyFromBuffer(
void *video,
const void *src,
int width,
int height)
override;
28 void CopyToBuffer(
const void *video,
void *dst,
int width,
int height)
override;
29 void CopyImageToBuffer(
const void *video,
void *dst,
int width,
int height,
int dst_pitch)
override;
30 void ScrollBuffer(
void *video,
int &left,
int &top,
int &width,
int &height,
int scroll_x,
int scroll_y)
override;
34 int BufferSize(
int width,
int height)
override;
38 const char *
GetName()
override {
return "40bpp-anim"; }
44 static inline Colour RealizeBlendedColour(uint8 anim,
Colour c)
virtual bool HasAnimBuffer()
Does this video driver support a separate animation buffer in addition to the colour buffer?
Blitter * CreateInstance() override
Create an instance of this Blitter-class.
void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) override
Draw a colourtable to the screen.
BlitterMode
The modes of blitting we can do.
How all blitters should look like.
The base factory, keeping track of all blitters.
ZoomLevel
All zoom levels we know.
void CopyToBuffer(const void *video, void *dst, int width, int height) override
Copy from the screen to a buffer.
bool IsUsable() const override
Is the blitter usable with the current drivers and hardware config?
const char * GetName() override
Get the name of the blitter, the same as the Factory-instance returns.
void CopyFromBuffer(void *video, const void *src, int width, int height) override
Copy from a buffer to the screen.
int BufferSize(int width, int height) override
Calculate how much memory there is needed for an image of this size in the video-buffer.
void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) override
Draws a sprite to a (screen) buffer.
void SetPixel(void *video, int x, int y, uint8 colour) override
Draw a pixel with a given colour on the video-buffer.
static Colour LookupColourInPalette(uint index)
Look up the colour in the current 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.
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.
Factory for the 40 bpp animated blitter (for OpenGL).
static VideoDriver * GetInstance()
Get the currently active instance of the video driver.
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.
Structure to access the alpha, red, green, and blue channels from a 32 bit number.
PaletteAnimation
Types of palette animation.
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.
uint32 PaletteID
The number of the palette.
Structure for passing information from the sprite loader to the blitter.
Sprite * Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) override
Convert a sprite from the loader to our own format.
bool NeedsAnimationBuffer() override
Does this blitter require a separate animation buffer from the video backend?
The optimized 40 bpp blitter (for OpenGL video driver).
Parameters related to blitting.
Data structure describing a sprite.
The optimised 32 bpp blitter (without palette animation).
Blitter::PaletteAnimation UsePaletteAnimation() override
Check if the blitter uses palette animation at all.