src/blitter/32bpp_anim.hpp
author truelight
Thu, 21 Jun 2007 13:31:41 +0000
changeset 7484 cdf0450632a1
parent 7481 699607d457a0
child 7485 68e3df6c477e
permissions -rw-r--r--
(svn r10244) -Fix: make sure to let 32bpp-anim report the increased buffer-size it needs
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     1
/* $Id$ */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     2
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     3
/** @file 32bpp_anim.hpp */
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     4
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     5
#ifndef BLITTER_32BPP_ANIM_HPP
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     6
#define BLITTER_32BPP_ANIM_HPP
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     7
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     8
#include "32bpp_simple.hpp"
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
     9
#include "factory.hpp"
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    10
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    11
class Blitter_32bppAnim : public Blitter_32bppSimple {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    12
private:
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    13
	uint8 *anim_buf; ///< In this buffer we keep track of the 8bpp indexes so we can do palette animation
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    14
	int anim_buf_width;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    15
	int anim_buf_height;
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    16
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    17
public:
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    18
	Blitter_32bppAnim() :
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    19
		anim_buf(NULL),
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    20
		anim_buf_width(0),
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    21
		anim_buf_height(0)
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    22
	{}
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    23
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    24
	/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom);
7481
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7467
diff changeset
    25
	/* virtual */ void DrawColorMappingRect(void *dst, int width, int height, int pal);
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    26
	/* virtual */ void SetPixel(void *video, int x, int y, uint8 color);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    27
	/* virtual */ void SetPixelIfEmpty(void *video, int x, int y, uint8 color);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    28
	/* virtual */ void DrawRect(void *video, int width, int height, uint8 color);
7481
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7467
diff changeset
    29
	/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height);
699607d457a0 (svn r10241) -Codechange: CopyToBuffer now produces a buffer that is unreadable from outside the blitter, so the blitter can store anything he likes
truelight
parents: 7467
diff changeset
    30
	/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height);
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    31
	/* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y);
7484
cdf0450632a1 (svn r10244) -Fix: make sure to let 32bpp-anim report the increased buffer-size it needs
truelight
parents: 7481
diff changeset
    32
	/* virtual */ int BufferSize(int width, int height);
7467
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    33
	/* virtual */ void PaletteAnimate(uint start, uint count);
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    34
	/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    35
};
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    36
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    37
class FBlitter_32bppAnim: public BlitterFactory<FBlitter_32bppAnim> {
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    38
public:
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    39
	/* virtual */ const char *GetName() { return "32bpp-anim"; }
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    40
	/* virtual */ const char *GetDescription() { return "32bpp Animation Blitter (palette animation)"; }
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    41
	/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppAnim(); }
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    42
};
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    43
cb1801e91c3d (svn r10227) -Add: added 32bpp-anim blitter, a 32bpp blitter that does palette animation (at the cost of an animation-buffer to keep track of the 'm'-channel of all sprites)
truelight
parents:
diff changeset
    44
#endif /* BLITTER_32BPP_ANIM_HPP */