Codechange: Allow for using a sprite encoder that is not the currently active blitter when loading a sprite.

This commit is contained in:
Michael Lutz
2021-01-16 16:43:27 +01:00
parent f94b2e73e1
commit 02e8741457
4 changed files with 41 additions and 16 deletions

View File

@@ -13,6 +13,9 @@
#include "../core/alloc_type.hpp"
#include "../gfx_type.h"
struct Sprite;
typedef void *AllocatorProc(size_t size);
/** Interface for the loader of our sprites. */
class SpriteLoader {
public:
@@ -64,4 +67,20 @@ public:
virtual ~SpriteLoader() { }
};
/** Interface for something that can encode a sprite. */
class SpriteEncoder {
public:
virtual ~SpriteEncoder() { }
/**
* Can the sprite encoder make use of RGBA sprites?
*/
virtual bool Is32BppSupported() = 0;
/**
* Convert a sprite from the loader to our own format.
*/
virtual Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) = 0;
};
#endif /* SPRITELOADER_HPP */