diff options
author | rubidium <rubidium@openttd.org> | 2011-12-08 19:37:33 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-12-08 19:37:33 +0000 |
commit | 61625e53c96572528745b79a63ba614b74c8f301 (patch) | |
tree | f748a6f1eb557f7466346597b167607d1ae75413 /src/blitter/32bpp_anim.cpp | |
parent | 8630e97b4f0d078ca492944f383790979b85f8c1 (diff) | |
download | openttd-61625e53c96572528745b79a63ba614b74c8f301.tar.xz |
(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)
Diffstat (limited to 'src/blitter/32bpp_anim.cpp')
-rw-r--r-- | src/blitter/32bpp_anim.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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); } |