summaryrefslogtreecommitdiff
path: root/src/spriteloader/spriteloader.hpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-06-11 11:50:49 +0000
committertruelight <truelight@openttd.org>2007-06-11 11:50:49 +0000
commit6b101cc177a9e689dd193041b82661ab140b817c (patch)
tree2fcb96fde1458283649c1303c0436fcfb369de55 /src/spriteloader/spriteloader.hpp
parent68c369ea98c4379c25300d055eb206ff8f4442cb (diff)
downloadopenttd-6b101cc177a9e689dd193041b82661ab140b817c.tar.xz
(svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
-Add: make it possible to pick your own blitter (-b <blitter>, -h for overview) -Add: added a new optimized 8bpp blitter (default, caches sprites of all zoom-levels) -Add: added a debug 8bpp blitter and a very slow normal 8bpp blitter
Diffstat (limited to 'src/spriteloader/spriteloader.hpp')
-rw-r--r--src/spriteloader/spriteloader.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/spriteloader/spriteloader.hpp b/src/spriteloader/spriteloader.hpp
new file mode 100644
index 000000000..658277236
--- /dev/null
+++ b/src/spriteloader/spriteloader.hpp
@@ -0,0 +1,34 @@
+/* $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, uint32 file_pos) = 0;
+
+ virtual ~SpriteLoader() { }
+};
+
+#endif /* SPRITELOADER_HPP */