src/blitter/32bpp_anim.hpp
branchNewGRF_ports
changeset 6720 35756db7e577
child 6870 ca3fd1fbe311
equal deleted inserted replaced
6719:4cc327ad39d5 6720:35756db7e577
       
     1 /* $Id$ */
       
     2 
       
     3 /** @file 32bpp_anim.hpp */
       
     4 
       
     5 #ifndef BLITTER_32BPP_ANIM_HPP
       
     6 #define BLITTER_32BPP_ANIM_HPP
       
     7 
       
     8 #include "32bpp_simple.hpp"
       
     9 #include "factory.hpp"
       
    10 
       
    11 class Blitter_32bppAnim : public Blitter_32bppSimple {
       
    12 private:
       
    13 	uint8 *anim_buf; ///< In this buffer we keep track of the 8bpp indexes so we can do palette animation
       
    14 	int anim_buf_width;
       
    15 	int anim_buf_height;
       
    16 
       
    17 public:
       
    18 	Blitter_32bppAnim() :
       
    19 		anim_buf(NULL),
       
    20 		anim_buf_width(0),
       
    21 		anim_buf_height(0)
       
    22 	{}
       
    23 
       
    24 	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
       
    25 	/* virtual */ void DrawColorMappingRect(void *dst, int width, int height, int pal);
       
    26 	/* virtual */ void SetPixel(void *video, int x, int y, uint8 color);
       
    27 	/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 color);
       
    28 	/* virtual */ void DrawRect(void *video, int width, int height, uint8 color);
       
    29 	/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
       
    30 	/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
       
    31 	/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
       
    32 	/* virtual */ int BufferSize(int width, int height);
       
    33 	/* virtual */ void PaletteAnimate(uint start, uint count);
       
    34 	/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
       
    35 
       
    36 	/* virtual */ const char *GetName() { return "32bpp-anim"; }
       
    37 };
       
    38 
       
    39 class FBlitter_32bppAnim: public BlitterFactory<FBlitter_32bppAnim> {
       
    40 public:
       
    41 	/* virtual */ const char *GetName() { return "32bpp-anim"; }
       
    42 	/* virtual */ const char *GetDescription() { return "32bpp Animation Blitter (palette animation)"; }
       
    43 	/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppAnim(); }
       
    44 };
       
    45 
       
    46 #endif /* BLITTER_32BPP_ANIM_HPP */