author | Tero Marttila <terom@fixme.fi> |
Fri, 19 Dec 2008 02:25:44 +0200 | |
branch | terom-mini |
changeset 10442 | 7089fa402bfd |
parent 9542 | bc9789270025 |
permissions | -rw-r--r-- |
6852
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
1 |
/* $Id$ */ |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
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:
6989
diff
changeset
|
3 |
/** @file 8bpp_optimized.hpp An optimized 8 bpp blitter. */ |
6852
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
4 |
|
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
5 |
#ifndef BLITTER_8BPP_OPTIMIZED_HPP |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
6 |
#define BLITTER_8BPP_OPTIMIZED_HPP |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
7 |
|
6937
40c760fcf1f6
(svn r10190) -Codechange: merged renderer and blitter to one single class API: blitter
truelight
parents:
6889
diff
changeset
|
8 |
#include "8bpp_base.hpp" |
40c760fcf1f6
(svn r10190) -Codechange: merged renderer and blitter to one single class API: blitter
truelight
parents:
6889
diff
changeset
|
9 |
#include "factory.hpp" |
6852
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
10 |
|
6937
40c760fcf1f6
(svn r10190) -Codechange: merged renderer and blitter to one single class API: blitter
truelight
parents:
6889
diff
changeset
|
11 |
class Blitter_8bppOptimized : public Blitter_8bppBase { |
40c760fcf1f6
(svn r10190) -Codechange: merged renderer and blitter to one single class API: blitter
truelight
parents:
6889
diff
changeset
|
12 |
public: |
9542
bc9789270025
(svn r13551) -Codechange: store offsets to different zoom levels in a distinguished struct instead in the data stream for 8bpp-optimized
smatz
parents:
9111
diff
changeset
|
13 |
struct SpriteData { |
bc9789270025
(svn r13551) -Codechange: store offsets to different zoom levels in a distinguished struct instead in the data stream for 8bpp-optimized
smatz
parents:
9111
diff
changeset
|
14 |
uint32 offset[ZOOM_LVL_COUNT]; ///< offsets (from .data) to streams for different zoom levels |
bc9789270025
(svn r13551) -Codechange: store offsets to different zoom levels in a distinguished struct instead in the data stream for 8bpp-optimized
smatz
parents:
9111
diff
changeset
|
15 |
byte data[VARARRAY_SIZE]; ///< data, all zoomlevels |
bc9789270025
(svn r13551) -Codechange: store offsets to different zoom levels in a distinguished struct instead in the data stream for 8bpp-optimized
smatz
parents:
9111
diff
changeset
|
16 |
}; |
bc9789270025
(svn r13551) -Codechange: store offsets to different zoom levels in a distinguished struct instead in the data stream for 8bpp-optimized
smatz
parents:
9111
diff
changeset
|
17 |
|
6878
5cefd3ac59c7
(svn r10121) -Codechange: split renderer from rest of code; no longer any code directly accesses the video-buffer
truelight
parents:
6867
diff
changeset
|
18 |
/* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); |
5cefd3ac59c7
(svn r10121) -Codechange: split renderer from rest of code; no longer any code directly accesses the video-buffer
truelight
parents:
6867
diff
changeset
|
19 |
/* virtual */ Sprite *Encode(SpriteLoader::Sprite *sprite, Blitter::AllocatorProc *allocator); |
6989
1768ca0091cb
(svn r10245) -Codechange: added GetName also to all Blitters, instead of only the Factory
truelight
parents:
6937
diff
changeset
|
20 |
|
1768ca0091cb
(svn r10245) -Codechange: added GetName also to all Blitters, instead of only the Factory
truelight
parents:
6937
diff
changeset
|
21 |
/* virtual */ const char *GetName() { return "8bpp-optimized"; } |
6852
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
22 |
}; |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
23 |
|
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
24 |
class FBlitter_8bppOptimized: public BlitterFactory<FBlitter_8bppOptimized> { |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
25 |
public: |
6867
a2a2d496738a
(svn r10107) -Fix (r10092): Missing 'i' in 'optimized'
peter1138
parents:
6862
diff
changeset
|
26 |
/* virtual */ const char *GetName() { return "8bpp-optimized"; } |
6852
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
27 |
/* virtual */ const char *GetDescription() { return "8bpp Optimized Blitter (compression + all-ZoomLevel cache)"; } |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
28 |
/* virtual */ Blitter *CreateInstance() { return new Blitter_8bppOptimized(); } |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
29 |
}; |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
30 |
|
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
31 |
#endif /* BLITTER_8BPP_OPTIMIZED_HPP */ |