12 #ifndef BLITTER_BASE_HPP 13 #define BLITTER_BASE_HPP 15 #include "../spritecache.h" 16 #include "../spriteloader/spriteloader.hpp" 92 virtual void *
MoveTo(
void *video,
int x,
int y) = 0;
101 virtual void SetPixel(
void *video,
int x,
int y, uint8 colour) = 0;
125 virtual void DrawLine(
void *video,
int x,
int y,
int x2,
int y2,
int screen_width,
int screen_height, uint8 colour,
int width,
int dash = 0);
193 virtual const char *
GetName() = 0;
int left
The left offset in the 'dst' in pixels to start drawing.
uint32 PaletteID
The number of the palette.
int sprite_width
Real width of the sprite.
Information about the currently used palette.
int height
The height in pixels that needs to be drawn to dst.
Perform transparency colour remapping.
int skip_top
How much pixels of the source to skip on the top (based on zoom of dst)
Data structure describing a sprite.
int sprite_height
Real height of the sprite.
virtual void SetPixel(void *video, int x, int y, uint8 colour)=0
Draw a pixel with a given colour on the video-buffer.
int width
The width in pixels that needs to be drawn to dst.
int skip_left
How much pixels of the source to skip on the left (based on zoom of dst)
virtual Sprite * Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)=0
Convert a sprite from the loader to our own format.
How all blitters should look like.
virtual void CopyImageToBuffer(const void *video, void *dst, int width, int height, int dst_pitch)=0
Copy from the screen to a buffer in a palette format for 8bpp and RGBA format for 32bpp...
virtual const char * GetName()=0
Get the name of the blitter, the same as the Factory-instance returns.
virtual void PostResize()
Post resize event.
virtual int GetBytesPerPixel()=0
Get how many bytes are needed to store a pixel.
Palette animation should be done by video backend (8bpp only!)
The blitter takes care of the palette animation.
virtual void DrawLine(void *video, int x, int y, int x2, int y2, int screen_width, int screen_height, uint8 colour, int width, int dash=0)
Draw a line with a given colour.
Parameters related to blitting.
virtual void PaletteAnimate(const Palette &palette)=0
Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to...
int pitch
The pitch of the destination buffer.
virtual void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)=0
Draw an image to the screen, given an amount of params defined above.
Perform a crash remapping.
Structure for passing information from the sprite loader to the blitter.
Perform remapping to a completely blackened sprite.
virtual void CopyToBuffer(const void *video, void *dst, int width, int height)=0
Copy from the screen to a buffer.
virtual Blitter::PaletteAnimation UsePaletteAnimation()=0
Check if the blitter uses palette animation at all.
virtual int BufferSize(int width, int height)=0
Calculate how much memory there is needed for an image of this size in the video-buffer.
virtual void DrawRect(void *video, int width, int height, uint8 colour)=0
Make a single horizontal line in a single colour on the video-buffer.
ZoomLevel
All zoom levels we know.
int top
The top offset in the 'dst' in pixels to start drawing.
const byte * remap
XXX – Temporary storage for remap array.
virtual void CopyFromBuffer(void *video, const void *src, int width, int height)=0
Copy from a buffer to the screen.
const void * sprite
Pointer to the sprite how ever the encoder stored it.
Perform a colour remapping.
virtual void * MoveTo(void *video, int x, int y)=0
Move the destination pointer the requested amount x and y, keeping in mind any pitch and bpp of the r...
void * dst
Destination buffer.
Perform the simple blitting.
virtual uint8 GetScreenDepth()=0
Get the screen depth this blitter works for.
BlitterMode
The modes of blitting we can do.
PaletteAnimation
Types of palette animation.
virtual void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal)=0
Draw a colourtable to the screen.
virtual void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y)=0
Scroll the videobuffer some 'x' and 'y' value.