author | rubidium |
Sun, 25 May 2008 19:17:03 +0000 | |
changeset 9354 | 845e07db4549 |
parent 9111 | 48ce04029fe4 |
child 9597 | 825e5483799b |
permissions | -rw-r--r-- |
6971
6dd4632b7c1d
(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$ */ |
6dd4632b7c1d
(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 |
|
9111
48ce04029fe4
(svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description.
rubidium
parents:
7553
diff
changeset
|
3 |
/** @file 32bpp_anim.hpp A 32 bpp blitter with animation support. */ |
6971
6dd4632b7c1d
(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 |
|
6dd4632b7c1d
(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 |
6dd4632b7c1d
(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 |
6dd4632b7c1d
(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 |
|
7553
63d4424de5d7
(svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
6989
diff
changeset
|
8 |
#include "32bpp_optimized.hpp" |
6971
6dd4632b7c1d
(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" |
6dd4632b7c1d
(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 |
|
7553
63d4424de5d7
(svn r11078) -Add: added 32bpp-optimized, which is almost twice as fast as 32bpp-simple (based on the work of frosch)
truelight
parents:
6989
diff
changeset
|
11 |
class Blitter_32bppAnim : public Blitter_32bppOptimized { |
6971
6dd4632b7c1d
(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: |
6dd4632b7c1d
(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 |
6dd4632b7c1d
(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; |
6dd4632b7c1d
(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; |
6dd4632b7c1d
(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 |
|
6dd4632b7c1d
(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: |
6dd4632b7c1d
(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() : |
6dd4632b7c1d
(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), |
6dd4632b7c1d
(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), |
6dd4632b7c1d
(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) |
6dd4632b7c1d
(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 |
{} |
6dd4632b7c1d
(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 |
|
6dd4632b7c1d
(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); |
6985
d50d59dca7c1
(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:
6971
diff
changeset
|
25 |
/* virtual */ void DrawColorMappingRect(void *dst, int width, int height, int pal); |
6971
6dd4632b7c1d
(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); |
6dd4632b7c1d
(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); |
6dd4632b7c1d
(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); |
6985
d50d59dca7c1
(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:
6971
diff
changeset
|
29 |
/* virtual */ void CopyFromBuffer(void *video, const void *src, int width, int height); |
d50d59dca7c1
(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:
6971
diff
changeset
|
30 |
/* virtual */ void CopyToBuffer(const void *video, void *dst, int width, int height); |
6971
6dd4632b7c1d
(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); |
6988
980738eadcc2
(svn r10244) -Fix: make sure to let 32bpp-anim report the increased buffer-size it needs
truelight
parents:
6985
diff
changeset
|
32 |
/* virtual */ int BufferSize(int width, int height); |
6971
6dd4632b7c1d
(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); |
6dd4632b7c1d
(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(); |
6989
1768ca0091cb
(svn r10245) -Codechange: added GetName also to all Blitters, instead of only the Factory
truelight
parents:
6988
diff
changeset
|
35 |
|
1768ca0091cb
(svn r10245) -Codechange: added GetName also to all Blitters, instead of only the Factory
truelight
parents:
6988
diff
changeset
|
36 |
/* virtual */ const char *GetName() { return "32bpp-anim"; } |
6971
6dd4632b7c1d
(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 |
}; |
6dd4632b7c1d
(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 |
|
6dd4632b7c1d
(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 |
class FBlitter_32bppAnim: public BlitterFactory<FBlitter_32bppAnim> { |
6dd4632b7c1d
(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 |
public: |
6dd4632b7c1d
(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 */ const char *GetName() { return "32bpp-anim"; } |
6dd4632b7c1d
(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 |
/* virtual */ const char *GetDescription() { return "32bpp Animation Blitter (palette animation)"; } |
6dd4632b7c1d
(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 |
/* virtual */ Blitter *CreateInstance() { return new Blitter_32bppAnim(); } |
6dd4632b7c1d
(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 |
}; |
6dd4632b7c1d
(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
|
45 |
|
6dd4632b7c1d
(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
|
46 |
#endif /* BLITTER_32BPP_ANIM_HPP */ |