The optimised 32 bpp blitter with palette animation. More...
#include <32bpp_anim.hpp>
Public Member Functions | |
| void | Draw (Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom) |
| Draws a sprite to a (screen) buffer. | |
| void | DrawColourMappingRect (void *dst, int width, int height, PaletteID pal) |
| Draw a colourtable to the screen. | |
| void | SetPixel (void *video, int x, int y, uint8 colour) |
| Draw a pixel with a given colour on the video-buffer. | |
| void | DrawRect (void *video, int width, int height, uint8 colour) |
| Make a single horizontal line in a single colour on the video-buffer. | |
| void | CopyFromBuffer (void *video, const void *src, int width, int height) |
| Copy from a buffer to the screen. | |
| void | CopyToBuffer (const void *video, void *dst, int width, int height) |
| Copy from the screen to a buffer. | |
| void | ScrollBuffer (void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) |
| Scroll the videobuffer some 'x' and 'y' value. | |
| int | BufferSize (int width, int height) |
| Calculate how much memory there is needed for an image of this size in the video-buffer. | |
| void | PaletteAnimate (const Palette &palette) |
| Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to the 8bpp palette indexes 'first_dirty' to 'first_dirty + count_dirty'. | |
| Blitter::PaletteAnimation | UsePaletteAnimation () |
| Check if the blitter uses palette animation at all. | |
| const char * | GetName () |
| Get the name of the blitter, the same as the Factory-instance returns. | |
| int | GetBytesPerPixel () |
| Get how many bytes are needed to store a pixel. | |
| void | PostResize () |
| Post resize event. | |
| uint32 | LookupColourInPalette (uint index) |
| Look up the colour in the current palette. | |
| template<BlitterMode mode> | |
| void | Draw (const Blitter::BlitterParams *bp, ZoomLevel zoom) |
| Draws a sprite to a (screen) buffer. | |
Private Attributes | |
| uint16 * | anim_buf |
| In this buffer we keep track of the 8bpp indexes so we can do palette animation. | |
| int | anim_buf_width |
| The width of the animation buffer. | |
| int | anim_buf_height |
| The height of the animation buffer. | |
| Palette | palette |
| The current palette. | |
The optimised 32 bpp blitter with palette animation.
Definition at line 18 of file 32bpp_anim.hpp.
| int Blitter_32bppAnim::BufferSize | ( | int | width, | |
| int | height | |||
| ) | [virtual] |
Calculate how much memory there is needed for an image of this size in the video-buffer.
| width | The width of the buffer-to-be. | |
| height | The height of the buffer-to-be. |
Reimplemented from Blitter_32bppBase.
Definition at line 409 of file 32bpp_anim.cpp.
| void Blitter_32bppAnim::CopyFromBuffer | ( | void * | video, | |
| const void * | src, | |||
| int | width, | |||
| int | height | |||
| ) | [virtual] |
Copy from a buffer to the screen.
| video | The destionation pointer (video-buffer). | |
| src | The buffer from which the data will be read. | |
| width | The width of the buffer. | |
| height | The height of the buffer. |
Reimplemented from Blitter_32bppBase.
Definition at line 295 of file 32bpp_anim.cpp.
References _screen_disable_anim, anim_buf, anim_buf_width, GB(), LookupColourInPalette(), and PALETTE_ANIM_START.
| void Blitter_32bppAnim::CopyToBuffer | ( | const void * | video, | |
| void * | dst, | |||
| int | width, | |||
| int | height | |||
| ) | [virtual] |
Copy from the screen to a buffer.
| video | The destination pointer (video-buffer). | |
| dst | The buffer in which the data will be stored. | |
| width | The width of the buffer. | |
| height | The height of the buffer. |
Reimplemented from Blitter_32bppBase.
Definition at line 335 of file 32bpp_anim.cpp.
References _screen_disable_anim, anim_buf, and anim_buf_width.
| void Blitter_32bppAnim::Draw | ( | Blitter::BlitterParams * | bp, | |
| BlitterMode | mode, | |||
| ZoomLevel | zoom | |||
| ) | [virtual] |
Draws a sprite to a (screen) buffer.
Calls adequate templated function.
| bp | further blitting parameters | |
| mode | blitter mode | |
| zoom | zoom level at which we are drawing |
Reimplemented from Blitter_32bppOptimized.
Definition at line 198 of file 32bpp_anim.cpp.
References _screen_disable_anim, BM_COLOUR_REMAP, BM_NORMAL, and BM_TRANSPARENT.
| void Blitter_32bppAnim::Draw | ( | const Blitter::BlitterParams * | bp, | |
| ZoomLevel | zoom | |||
| ) | [inline] |
Draws a sprite to a (screen) buffer.
It is templated to allow faster operation.
| mode | blitter mode |
| bp | further blitting parameters | |
| zoom | zoom level at which we are drawing |
Reimplemented from Blitter_32bppOptimized.
Definition at line 22 of file 32bpp_anim.cpp.
References anim_buf_width, BM_COLOUR_REMAP, BM_TRANSPARENT, Blitter_32bppBase::ComposeColourPANoCheck(), Blitter_32bppBase::ComposeColourRGBANoCheck(), Blitter_32bppOptimized::SpriteData::data, Blitter::BlitterParams::dst, GB(), Blitter::BlitterParams::height, Blitter::BlitterParams::left, LookupColourInPalette(), Blitter_32bppBase::MakeTransparent(), Blitter_32bppOptimized::SpriteData::offset, PALETTE_ANIM_START, Blitter::BlitterParams::pitch, Blitter::BlitterParams::remap, Blitter::BlitterParams::skip_left, Blitter::BlitterParams::skip_top, Blitter::BlitterParams::sprite, Blitter::BlitterParams::top, and Blitter::BlitterParams::width.
| void Blitter_32bppAnim::DrawColourMappingRect | ( | void * | dst, | |
| int | width, | |||
| int | height, | |||
| PaletteID | pal | |||
| ) | [virtual] |
Draw a colourtable to the screen.
This is: the colour of the screen is read and is looked-up in the palette to match a new colour, which then is put on the screen again.
| dst | the destination pointer (video-buffer). | |
| width | the width of the buffer. | |
| height | the height of the buffer. | |
| pal | the palette to use. |
Reimplemented from Blitter_32bppSimple.
Definition at line 214 of file 32bpp_anim.cpp.
References _screen_disable_anim, anim_buf, anim_buf_width, DEBUG, Blitter_32bppBase::MakeGrey(), Blitter_32bppBase::MakeTransparent(), PALETTE_NEWSPAPER, and PALETTE_TO_TRANSPARENT.
| void Blitter_32bppAnim::DrawRect | ( | void * | video, | |
| int | width, | |||
| int | height, | |||
| uint8 | colour | |||
| ) | [virtual] |
Make a single horizontal line in a single colour on the video-buffer.
| video | The destination pointer (video-buffer). | |
| width | The length of the line. | |
| height | The height of the line. | |
| colour | A 8bpp mapping colour. |
Reimplemented from Blitter_32bppBase.
Definition at line 266 of file 32bpp_anim.cpp.
References _screen_disable_anim, anim_buf, and LookupColourInPalette().
| void Blitter_32bppAnim::PaletteAnimate | ( | const Palette & | palette | ) | [virtual] |
Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to the 8bpp palette indexes 'first_dirty' to 'first_dirty + count_dirty'.
| palette | The new palette. |
Reimplemented from Blitter_32bppBase.
Definition at line 414 of file 32bpp_anim.cpp.
References _screen_disable_anim, _video_driver, anim_buf, anim_buf_height, anim_buf_width, Palette::first_dirty, GB(), LookupColourInPalette(), VideoDriver::MakeDirty(), and PALETTE_ANIM_START.
| void Blitter_32bppAnim::ScrollBuffer | ( | void * | video, | |
| int & | left, | |||
| int & | top, | |||
| int & | width, | |||
| int & | height, | |||
| int | scroll_x, | |||
| int | scroll_y | |||
| ) | [virtual] |
Scroll the videobuffer some 'x' and 'y' value.
| video | The buffer to scroll into. | |
| left | The left value of the screen to scroll. | |
| top | The top value of the screen to scroll. | |
| width | The width of the screen to scroll. | |
| height | The height of the screen to scroll. | |
| scroll_x | How much to scroll in X. | |
| scroll_y | How much to scroll in Y. |
Reimplemented from Blitter_32bppBase.
Definition at line 358 of file 32bpp_anim.cpp.
References _screen_disable_anim, anim_buf, and anim_buf_width.
| void Blitter_32bppAnim::SetPixel | ( | void * | video, | |
| int | x, | |||
| int | y, | |||
| uint8 | colour | |||
| ) | [virtual] |
Draw a pixel with a given colour on the video-buffer.
| video | The destination pointer (video-buffer). | |
| x | The x position within video-buffer. | |
| y | The y position within video-buffer. | |
| colour | A 8bpp mapping colour. |
Reimplemented from Blitter_32bppBase.
Definition at line 257 of file 32bpp_anim.cpp.
References _screen_disable_anim, anim_buf, anim_buf_width, and LookupColourInPalette().
| Blitter::PaletteAnimation Blitter_32bppAnim::UsePaletteAnimation | ( | ) | [virtual] |
Check if the blitter uses palette animation at all.
Reimplemented from Blitter_32bppBase.
Definition at line 445 of file 32bpp_anim.cpp.
1.7.1