author | Tero Marttila <terom@fixme.fi> |
Fri, 19 Dec 2008 02:25:44 +0200 | |
branch | terom-mini |
changeset 10442 | 7089fa402bfd |
parent 10056 | 48659f7d4fa5 |
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:
8374
diff
changeset
|
3 |
/** @file spriteloader.hpp Base for loading sprites. */ |
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 SPRITELOADER_HPP |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
6 |
#define SPRITELOADER_HPP |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
7 |
|
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
8 |
class SpriteLoader { |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
9 |
public: |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
10 |
struct CommonPixel { |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
11 |
uint8 r; ///< Red-channel |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
12 |
uint8 g; ///< Green-channel |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
13 |
uint8 b; ///< Blue-channel |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
14 |
uint8 a; ///< Alpha-channel |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
15 |
uint8 m; ///< Remap-channel |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
16 |
}; |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
17 |
|
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
18 |
struct Sprite { |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
19 |
uint16 height; ///< Height of the sprite |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
20 |
uint16 width; ///< Width of the sprite |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
21 |
int16 x_offs; ///< The x-offset of where the sprite will be drawn |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
22 |
int16 y_offs; ///< The y-offset of where the sprite will be drawn |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
23 |
SpriteLoader::CommonPixel *data; ///< The sprite itself |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
24 |
}; |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
25 |
|
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
26 |
/** |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
27 |
* Load a sprite from the disk and return a sprite struct which is the same for all loaders. |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
28 |
*/ |
10056
48659f7d4fa5
(svn r14223) -Codechange: make GetSprite aware of the 4 different types of sprites: fonts, recolour, mapgen and normal sprites.
rubidium
parents:
9390
diff
changeset
|
29 |
virtual bool LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, size_t file_pos, SpriteType sprite_type) = 0; |
6852
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 |
virtual ~SpriteLoader() { } |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
32 |
}; |
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
33 |
|
439563b70fd3
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
truelight
parents:
diff
changeset
|
34 |
#endif /* SPRITELOADER_HPP */ |