summaryrefslogtreecommitdiff
path: root/src/blitter/base.hpp
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-06-19 15:04:08 +0000
committertruelight <truelight@openttd.org>2007-06-19 15:04:08 +0000
commit1c4760ee06fb632d27648175f7bab433b32c1892 (patch)
treeaacf68dc44607bc64afffcb18f3bcbf65d05d654 /src/blitter/base.hpp
parent9ad02c11c62bec4027f36fadbab9d81180dc2721 (diff)
downloadopenttd-1c4760ee06fb632d27648175f7bab433b32c1892.tar.xz
(svn r10216) -Fix: palette animation always redid all palette entries, where in fact only a few indexes were needed
-Codechange: allow blitters to handle palette animation internally or even disable it; 8bpp uses video-backend for palette animation
Diffstat (limited to 'src/blitter/base.hpp')
-rw-r--r--src/blitter/base.hpp20
1 files changed, 20 insertions, 0 deletions
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() { }
};