src/spriteloader/spriteloader.hpp
author celestar
Tue, 19 Jun 2007 07:21:01 +0000
branchgamebalance
changeset 9913 e79cd19772dd
parent 9912 1ac8aac92385
child 8066 7acd480e05c9
permissions -rw-r--r--
(svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
/* $Id$ */

/** @file spriteloader.hpp */

#ifndef SPRITELOADER_HPP
#define SPRITELOADER_HPP

class SpriteLoader {
public:
	struct CommonPixel {
		uint8 r;  ///< Red-channel
		uint8 g;  ///< Green-channel
		uint8 b;  ///< Blue-channel
		uint8 a;  ///< Alpha-channel
		uint8 m;  ///< Remap-channel
	};

	struct Sprite {
		uint16 height;                   ///< Height of the sprite
		uint16 width;                    ///< Width of the sprite
		int16 x_offs;                    ///< The x-offset of where the sprite will be drawn
		int16 y_offs;                    ///< The y-offset of where the sprite will be drawn
		SpriteLoader::CommonPixel *data; ///< The sprite itself
	};

	/**
	 * Load a sprite from the disk and return a sprite struct which is the same for all loaders.
	 */
	virtual bool LoadSprite(SpriteLoader::Sprite *sprite, const char *filename, uint32 file_pos) = 0;

	virtual ~SpriteLoader() { }
};

#endif /* SPRITELOADER_HPP */