From 02e874145792670c46205d28e876b01de4cc2348 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 16 Jan 2021 16:43:27 +0100 Subject: Codechange: Allow for using a sprite encoder that is not the currently active blitter when loading a sprite. --- src/blitter/base.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/blitter/base.hpp') 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. */ @@ -74,11 +79,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. -- cgit v1.2.3-54-g00ecf