diff options
Diffstat (limited to 'src/blitter')
-rw-r--r-- | src/blitter/32bpp_base.cpp | 10 | ||||
-rw-r--r-- | src/blitter/32bpp_base.hpp | 2 | ||||
-rw-r--r-- | src/blitter/8bpp_base.cpp | 10 | ||||
-rw-r--r-- | src/blitter/8bpp_base.hpp | 2 | ||||
-rw-r--r-- | src/blitter/base.hpp | 20 | ||||
-rw-r--r-- | src/blitter/null.hpp | 2 |
6 files changed, 46 insertions, 0 deletions
diff --git a/src/blitter/32bpp_base.cpp b/src/blitter/32bpp_base.cpp index f788b56a7..a4e24cae9 100644 --- a/src/blitter/32bpp_base.cpp +++ b/src/blitter/32bpp_base.cpp @@ -177,3 +177,13 @@ int Blitter_32bppBase::BufferSize(int width, int height) { return width * height * sizeof(uint32); } + +void Blitter_32bppBase::PaletteAnimate(uint start, uint count) +{ + /* By default, 32bpp doesn't have palette animation */ +} + +Blitter::PaletteAnimation Blitter_32bppBase::UsePaletteAnimation() +{ + return Blitter::PALETTE_ANIMATION_NONE; +} diff --git a/src/blitter/32bpp_base.hpp b/src/blitter/32bpp_base.hpp index 0149330d8..66d7e7529 100644 --- a/src/blitter/32bpp_base.hpp +++ b/src/blitter/32bpp_base.hpp @@ -23,6 +23,8 @@ public: /* virtual */ void MoveBuffer(void *video_dst, const void *video_src, int width, int height); /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y); /* virtual */ int BufferSize(int width, int height); + /* virtual */ void PaletteAnimate(uint start, uint count); + /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation(); static inline uint32 LookupColourInPalette(uint8 index) { #define ARGB(a, r, g, b) ((((a) << 24) & 0xFF000000) | (((r) << 16) & 0x00FF0000) | (((g) << 8) & 0x0000FF00) | ((b) & 0x000000FF)) diff --git a/src/blitter/8bpp_base.cpp b/src/blitter/8bpp_base.cpp index 42da38937..6fe60ea18 100644 --- a/src/blitter/8bpp_base.cpp +++ b/src/blitter/8bpp_base.cpp @@ -182,3 +182,13 @@ int Blitter_8bppBase::BufferSize(int width, int height) { return width * height; } + +void Blitter_8bppBase::PaletteAnimate(uint start, uint count) +{ + /* Video backend takes care of the palette animation */ +} + +Blitter::PaletteAnimation Blitter_8bppBase::UsePaletteAnimation() +{ + return Blitter::PALETTE_ANIMATION_VIDEO_BACKEND; +} diff --git a/src/blitter/8bpp_base.hpp b/src/blitter/8bpp_base.hpp index 3b313bb30..f189ffdcf 100644 --- a/src/blitter/8bpp_base.hpp +++ b/src/blitter/8bpp_base.hpp @@ -23,6 +23,8 @@ public: /* virtual */ void MoveBuffer(void *video_dst, const void *video_src, int width, int height); /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y); /* virtual */ int BufferSize(int width, int height); + /* virtual */ void PaletteAnimate(uint start, uint count); + /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation(); }; #endif /* BLITTER_8BPP_BASE_HPP */ diff --git a/src/blitter/base.hpp b/src/blitter/base.hpp index 90e1dde03..268e13b17 100644 --- a/src/blitter/base.hpp +++ b/src/blitter/base.hpp @@ -31,6 +31,12 @@ public: int pitch; ///< The pitch of the destination buffer }; + enum PaletteAnimation { + PALETTE_ANIMATION_NONE, ///< No palette animation + PALETTE_ANIMATION_VIDEO_BACKEND, ///< Palette animation should be done by video backend (8bpp only!) + PALETTE_ANIMATION_BLITTER, ///< The blitter takes care of the palette animation + }; + typedef void *AllocatorProc(size_t size); /** @@ -158,6 +164,20 @@ public: */ virtual int BufferSize(int width, int height) = 0; + /** + * Called when the 8bpp palette is changed; you should redraw all pixels on the screen that + * are equal to the 8bpp palette indexes 'start' to 'start + count'. + * @param start The start index in the 8bpp palette. + * @param count The amount of indexes that are (possible) changed. + */ + virtual void PaletteAnimate(uint start, uint count) = 0; + + /** + * Check if the blitter uses palette animation at all. + * @return True if it uses palette animation. + */ + virtual Blitter::PaletteAnimation UsePaletteAnimation() = 0; + virtual ~Blitter() { } }; diff --git a/src/blitter/null.hpp b/src/blitter/null.hpp index 6c519b023..356385726 100644 --- a/src/blitter/null.hpp +++ b/src/blitter/null.hpp @@ -24,6 +24,8 @@ public: /* virtual */ void MoveBuffer(void *video_dst, const void *video_src, int width, int height) {}; /* virtual */ void ScrollBuffer(void *video, int &left, int &top, int &width, int &height, int scroll_x, int scroll_y) {}; /* virtual */ int BufferSize(int width, int height) { return 0; }; + /* virtual */ void PaletteAnimate(uint start, uint count) { }; + /* virtual */ Blitter::PaletteAnimation UsePaletteAnimation() { return Blitter::PALETTE_ANIMATION_NONE; }; }; class FBlitter_Null: public BlitterFactory<FBlitter_Null> { |