truelight@6852: /* $Id$ */ truelight@6852: truelight@6852: /** @file spriteloader.hpp */ truelight@6852: truelight@6852: #ifndef SPRITELOADER_HPP truelight@6852: #define SPRITELOADER_HPP truelight@6852: truelight@6852: class SpriteLoader { truelight@6852: public: truelight@6852: struct CommonPixel { truelight@6852: uint8 r; ///< Red-channel truelight@6852: uint8 g; ///< Green-channel truelight@6852: uint8 b; ///< Blue-channel truelight@6852: uint8 a; ///< Alpha-channel truelight@6852: uint8 m; ///< Remap-channel truelight@6852: }; truelight@6852: truelight@6852: struct Sprite { truelight@6852: uint16 height; ///< Height of the sprite truelight@6852: uint16 width; ///< Width of the sprite truelight@6852: int16 x_offs; ///< The x-offset of where the sprite will be drawn truelight@6852: int16 y_offs; ///< The y-offset of where the sprite will be drawn truelight@6852: SpriteLoader::CommonPixel *data; ///< The sprite itself truelight@6852: }; truelight@6852: truelight@6852: /** truelight@6852: * Load a sprite from the disk and return a sprite struct which is the same for all loaders. truelight@6852: */ peter1138@8374: virtual bool LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot, uint32 file_pos) = 0; truelight@6852: truelight@6852: virtual ~SpriteLoader() { } truelight@6852: }; truelight@6852: truelight@6852: #endif /* SPRITELOADER_HPP */