author | truebrain |
Mon, 23 Jun 2008 13:52:21 +0000 | |
branch | noai |
changeset 11058 | 3305a425f55b |
parent 10776 | 07203fc29812 |
permissions | -rw-r--r-- |
9626 | 1 |
/* $Id$ */ |
2 |
||
10455
22c441f5adf9
(svn r12997) [NoAI] -Sync: with trunk r12895:12996.
rubidium
parents:
9724
diff
changeset
|
3 |
/** @file spriteloader.hpp Base for loading sprites. */ |
9626 | 4 |
|
5 |
#ifndef SPRITELOADER_HPP |
|
6 |
#define SPRITELOADER_HPP |
|
7 |
||
8 |
class SpriteLoader { |
|
9 |
public: |
|
10 |
struct CommonPixel { |
|
11 |
uint8 r; ///< Red-channel |
|
12 |
uint8 g; ///< Green-channel |
|
13 |
uint8 b; ///< Blue-channel |
|
14 |
uint8 a; ///< Alpha-channel |
|
15 |
uint8 m; ///< Remap-channel |
|
16 |
}; |
|
17 |
||
18 |
struct Sprite { |
|
19 |
uint16 height; ///< Height of the sprite |
|
20 |
uint16 width; ///< Width of the sprite |
|
21 |
int16 x_offs; ///< The x-offset of where the sprite will be drawn |
|
22 |
int16 y_offs; ///< The y-offset of where the sprite will be drawn |
|
23 |
SpriteLoader::CommonPixel *data; ///< The sprite itself |
|
24 |
}; |
|
25 |
||
26 |
/** |
|
27 |
* Load a sprite from the disk and return a sprite struct which is the same for all loaders. |
|
28 |
*/ |
|
10776 | 29 |
virtual bool LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, size_t file_pos) = 0; |
9626 | 30 |
|
31 |
virtual ~SpriteLoader() { } |
|
32 |
}; |
|
33 |
||
34 |
#endif /* SPRITELOADER_HPP */ |