(svn r23448) -Fix: keep a local copy of the palette in the 32bpp animated blitter so changes of the palette data during the game don't influence drawing (with SDL)

This commit is contained in:
rubidium
2011-12-08 19:37:33 +00:00
parent 8630e97b4f
commit 61625e53c9
12 changed files with 36 additions and 34 deletions

View File

@@ -20,6 +20,7 @@ private:
uint8 *anim_buf; ///< In this buffer we keep track of the 8bpp indexes so we can do palette animation
int anim_buf_width; ///< The width of the animation buffer.
int anim_buf_height; ///< The height of the animation buffer.
Palette palette; ///< The current palette.
public:
Blitter_32bppAnim() :
@@ -36,13 +37,21 @@ public:
/* virtual */ void CopyToBuffer(const void *video, void *dst, 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 */ void PaletteAnimate(const Palette &palette);
/* virtual */ Blitter::PaletteAnimation UsePaletteAnimation();
/* virtual */ const char *GetName() { return "32bpp-anim"; }
/* virtual */ int GetBytesPerPixel() { return 5; }
/* virtual */ void PostResize();
/**
* Look up the colour in the current palette.
*/
inline uint32 LookupColourInPalette(uint index)
{
return this->palette.palette[index].data;
}
template <BlitterMode mode> void Draw(const Blitter::BlitterParams *bp, ZoomLevel zoom);
};