(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

@@ -410,14 +410,15 @@ int Blitter_32bppAnim::BufferSize(int width, int height)
return width * height * (sizeof(uint32) + sizeof(uint8));
}
void Blitter_32bppAnim::PaletteAnimate(uint start, uint count)
void Blitter_32bppAnim::PaletteAnimate(const Palette &palette)
{
assert(!_screen_disable_anim);
this->palette = palette;
/* Never repaint the transparency pixel */
if (start == 0) {
start++;
count--;
if (this->palette.first_dirty == 0) {
this->palette.first_dirty++;
this->palette.count_dirty--;
}
const uint8 *anim = this->anim_buf;
@@ -427,7 +428,7 @@ void Blitter_32bppAnim::PaletteAnimate(uint start, uint count)
for (int y = this->anim_buf_height; y != 0 ; y--) {
for (int x = this->anim_buf_width; x != 0 ; x--) {
uint colour = *anim;
if (IsInsideBS(colour, start, count)) {
if (IsInsideBS(colour, this->palette.first_dirty, this->palette.count_dirty)) {
/* Update this pixel */
*dst = LookupColourInPalette(colour);
}