Blitter_32bppAnim Class Reference

Inheritance diagram for Blitter_32bppAnim:

Blitter_32bppOptimized Blitter_32bppSimple Blitter_32bppBase Blitter

Public Member Functions

 Blitter_32bppAnim ()
void Draw (Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom)
 Draws a sprite to a (screen) buffer.
void DrawColorMappingRect (void *dst, int width, int height, int pal)
 Draw a colortable to the screen.
void SetPixel (void *video, int x, int y, uint8 color)
 Draw a pixel with a given color on the video-buffer.
void SetPixelIfEmpty (void *video, int x, int y, uint8 color)
 Draw a pixel with a given color on the video-buffer if there is currently a black pixel.
void DrawRect (void *video, int width, int height, uint8 color)
 Make a single horizontal line in a single color 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 (uint start, uint count)
 Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to the 8bpp palette indexes 'start' to 'start + count'.
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.
template<BlitterMode mode>
void Draw (const Blitter::BlitterParams *bp, ZoomLevel zoom)
 Draws a sprite to a (screen) buffer.

Private Attributes

uint8anim_buf
 In this buffer we keep track of the 8bpp indexes so we can do palette animation.
int anim_buf_width
int anim_buf_height

Detailed Description

Definition at line 11 of file 32bpp_anim.hpp.


Member Function Documentation

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.

Parameters:
width The width of the buffer-to-be.
height The height of the buffer-to-be.
Returns:
The size needed for the buffer.

Reimplemented from Blitter_32bppBase.

Definition at line 401 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.

Parameters:
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.
Note:
You can not do anything with the content of the buffer, as the blitter can store non-pixel data in it too!

Reimplemented from Blitter_32bppBase.

Definition at line 309 of file 32bpp_anim.cpp.

References _screen, _screen_disable_anim, _use_palette, anim_buf_width, assert, DrawPixelInfo::dst_ptr, DrawPixelInfo::height, PAL_DOS, PALETTE_ANIM_SIZE_DOS, PALETTE_ANIM_SIZE_START, PALETTE_ANIM_SIZE_WIN, PaletteAnimate(), DrawPixelInfo::pitch, and DrawPixelInfo::width.

void Blitter_32bppAnim::CopyToBuffer ( const void *  video,
void *  dst,
int  width,
int  height 
) [virtual]

Copy from the screen to a buffer.

Parameters:
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.
Note:
You can not do anything with the content of the buffer, as the blitter can store non-pixel data in it too!

Reimplemented from Blitter_32bppBase.

Definition at line 333 of file 32bpp_anim.cpp.

References _screen, _screen_disable_anim, anim_buf_width, assert, DrawPixelInfo::dst_ptr, DrawPixelInfo::height, DrawPixelInfo::pitch, and DrawPixelInfo::width.

template<BlitterMode mode>
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.

Parameters:
mode blitter mode
bp further blitting parameters
zoom zoom level at which we are drawing

Reimplemented from Blitter_32bppOptimized.

Definition at line 19 of file 32bpp_anim.cpp.

References _screen, anim_buf_width, Blitter_32bppBase::ComposeColourPANoCheck(), Blitter_32bppBase::ComposeColourRGBANoCheck(), Blitter::BlitterParams::dst, DrawPixelInfo::dst_ptr, Blitter::BlitterParams::height, Blitter::BlitterParams::left, Blitter_32bppBase::LookupColourInPalette(), Blitter_32bppBase::MakeTransparent(), PALETTE_ANIM_SIZE_START, Blitter::BlitterParams::pitch, Blitter::BlitterParams::remap, Blitter::BlitterParams::skip_left, Blitter::BlitterParams::skip_top, Blitter::BlitterParams::sprite, Blitter::BlitterParams::top, Blitter::BlitterParams::width, and y.

void Blitter_32bppAnim::Draw ( Blitter::BlitterParams bp,
BlitterMode  mode,
ZoomLevel  zoom 
) [virtual]

Draws a sprite to a (screen) buffer.

Calls adequate templated function.

Parameters:
bp further blitting parameters
mode blitter mode
zoom zoom level at which we are drawing

Reimplemented from Blitter_32bppOptimized.

Definition at line 193 of file 32bpp_anim.cpp.

References _screen, _screen_disable_anim, anim_buf, anim_buf_height, anim_buf_width, Blitter_32bppOptimized::Draw(), DrawPixelInfo::height, NOT_REACHED, and DrawPixelInfo::width.

void Blitter_32bppAnim::DrawColorMappingRect ( void *  dst,
int  width,
int  height,
int  pal 
) [virtual]

Draw a colortable to the screen.

This is: the color of the screen is read and is looked-up in the palette to match a new color, which then is put on the screen again.

Parameters:
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 217 of file 32bpp_anim.cpp.

References _screen, _screen_disable_anim, anim_buf, anim_buf_width, DEBUG, Blitter_32bppSimple::DrawColorMappingRect(), DrawPixelInfo::dst_ptr, Blitter_32bppBase::MakeGrey(), Blitter_32bppBase::MakeTransparent(), and DrawPixelInfo::pitch.

void Blitter_32bppAnim::DrawRect ( void *  video,
int  width,
int  height,
uint8  color 
) [virtual]

Make a single horizontal line in a single color on the video-buffer.

Parameters:
video The destination pointer (video-buffer).
width The lenght of the line.
color A 8bpp mapping color.

Reimplemented from Blitter_32bppBase.

Definition at line 280 of file 32bpp_anim.cpp.

References _screen, _screen_disable_anim, Blitter_32bppBase::DrawRect(), DrawPixelInfo::dst_ptr, Blitter_32bppBase::LookupColourInPalette(), and DrawPixelInfo::pitch.

void Blitter_32bppAnim::PaletteAnimate ( uint  start,
uint  count 
) [virtual]

Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to the 8bpp palette indexes 'start' to 'start + count'.

Parameters:
start The start index in the 8bpp palette.
count The amount of indexes that are (possible) changed.

Reimplemented from Blitter_32bppBase.

Definition at line 406 of file 32bpp_anim.cpp.

References _screen, _screen_disable_anim, _video_driver, anim_buf, anim_buf_width, assert, DrawPixelInfo::dst_ptr, DrawPixelInfo::height, IsInsideBS(), Blitter_32bppBase::LookupColourInPalette(), VideoDriver::MakeDirty(), DrawPixelInfo::pitch, DrawPixelInfo::width, x, and y.

Referenced by CopyFromBuffer().

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.

Parameters:
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 356 of file 32bpp_anim.cpp.

References _screen, _screen_disable_anim, anim_buf, anim_buf_width, assert, DrawPixelInfo::dst_ptr, DrawPixelInfo::height, DrawPixelInfo::pitch, Blitter_32bppBase::ScrollBuffer(), and DrawPixelInfo::width.

void Blitter_32bppAnim::SetPixel ( void *  video,
int  x,
int  y,
uint8  color 
) [virtual]

Draw a pixel with a given color on the video-buffer.

Parameters:
video The destination pointer (video-buffer).
x The x position within video-buffer.
y The y position within video-buffer.
color A 8bpp mapping color.

Reimplemented from Blitter_32bppBase.

Definition at line 260 of file 32bpp_anim.cpp.

References _screen, _screen_disable_anim, anim_buf, DrawPixelInfo::dst_ptr, Blitter_32bppBase::LookupColourInPalette(), and DrawPixelInfo::pitch.

void Blitter_32bppAnim::SetPixelIfEmpty ( void *  video,
int  x,
int  y,
uint8  color 
) [virtual]

Draw a pixel with a given color on the video-buffer if there is currently a black pixel.

Parameters:
video The destination pointer (video-buffer).
x The x position within video-buffer.
y The y position within video-buffer.
color A 8bpp mapping color.

Reimplemented from Blitter_32bppBase.

Definition at line 269 of file 32bpp_anim.cpp.

References _screen, _screen_disable_anim, anim_buf, DrawPixelInfo::dst_ptr, Blitter_32bppBase::LookupColourInPalette(), and DrawPixelInfo::pitch.

Blitter::PaletteAnimation Blitter_32bppAnim::UsePaletteAnimation (  )  [virtual]

Check if the blitter uses palette animation at all.

Returns:
True if it uses palette animation.

Reimplemented from Blitter_32bppBase.

Definition at line 437 of file 32bpp_anim.cpp.

References Blitter::PALETTE_ANIMATION_BLITTER.


The documentation for this class was generated from the following files:
Generated on Sat Sep 6 20:15:59 2008 for openttd by  doxygen 1.4.7