From 61625e53c96572528745b79a63ba614b74c8f301 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 8 Dec 2011 19:37:33 +0000 Subject: (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) --- src/blitter/32bpp_anim.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/blitter/32bpp_anim.cpp') diff --git a/src/blitter/32bpp_anim.cpp b/src/blitter/32bpp_anim.cpp index be8c26f6c..bb14d4608 100644 --- a/src/blitter/32bpp_anim.cpp +++ b/src/blitter/32bpp_anim.cpp @@ -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); } -- cgit v1.2.3-54-g00ecf