diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-01-16 16:43:27 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-02-22 22:16:07 +0100 |
commit | 02e874145792670c46205d28e876b01de4cc2348 (patch) | |
tree | 9222ca749d6433baeef18f761d475d9b88564e4e /src/blitter | |
parent | f94b2e73e118522c29898a77c2de4bd23451e1c7 (diff) | |
download | openttd-02e874145792670c46205d28e876b01de4cc2348.tar.xz |
Codechange: Allow for using a sprite encoder that is not the currently active blitter when loading a sprite.
Diffstat (limited to 'src/blitter')
-rw-r--r-- | src/blitter/base.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/blitter/base.hpp b/src/blitter/base.hpp index 10dfce84b..6b19c290b 100644 --- a/src/blitter/base.hpp +++ b/src/blitter/base.hpp @@ -25,7 +25,7 @@ enum BlitterMode { /** * How all blitters should look like. Extend this class to make your own. */ -class Blitter { +class Blitter : public SpriteEncoder { public: /** Parameters related to blitting. */ struct BlitterParams { @@ -58,6 +58,11 @@ public: */ virtual uint8 GetScreenDepth() = 0; + bool Is32BppSupported() override + { + return this->GetScreenDepth() > 8; + } + /** * Draw an image to the screen, given an amount of params defined above. */ @@ -75,11 +80,6 @@ public: virtual void DrawColourMappingRect(void *dst, int width, int height, PaletteID pal) = 0; /** - * Convert a sprite from the loader to our own format. - */ - virtual Sprite *Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator) = 0; - - /** * Move the destination pointer the requested amount x and y, keeping in mind * any pitch and bpp of the renderer. * @param video The destination pointer (video-buffer) to scroll. |