forked from mirror/OpenTTD
(svn r23446) -Codechange: move _cur_palette and it's related first/count dirty variables into a single structure
This commit is contained in:
@@ -75,9 +75,9 @@ static void UpdatePalette(uint start, uint count)
|
||||
|
||||
uint end = start + count;
|
||||
for (uint i = start; i != end; i++) {
|
||||
pal[i].r = _cur_palette[i].r / 4;
|
||||
pal[i].g = _cur_palette[i].g / 4;
|
||||
pal[i].b = _cur_palette[i].b / 4;
|
||||
pal[i].r = _cur_palette.palette[i].r / 4;
|
||||
pal[i].g = _cur_palette.palette[i].g / 4;
|
||||
pal[i].b = _cur_palette.palette[i].b / 4;
|
||||
pal[i].filler = 0;
|
||||
}
|
||||
|
||||
@@ -91,16 +91,16 @@ static void InitPalette()
|
||||
|
||||
static void CheckPaletteAnim()
|
||||
{
|
||||
if (_pal_count_dirty != 0) {
|
||||
if (_cur_palette.count_dirty != 0) {
|
||||
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
|
||||
|
||||
switch (blitter->UsePaletteAnimation()) {
|
||||
case Blitter::PALETTE_ANIMATION_VIDEO_BACKEND:
|
||||
UpdatePalette(_pal_first_dirty, _pal_count_dirty);
|
||||
UpdatePalette(_cur_palette.first_dirty, _cur_palette.count_dirty);
|
||||
break;
|
||||
|
||||
case Blitter::PALETTE_ANIMATION_BLITTER:
|
||||
blitter->PaletteAnimate(_pal_first_dirty, _pal_count_dirty);
|
||||
blitter->PaletteAnimate(_cur_palette.first_dirty, _cur_palette.count_dirty);
|
||||
break;
|
||||
|
||||
case Blitter::PALETTE_ANIMATION_NONE:
|
||||
@@ -109,7 +109,7 @@ static void CheckPaletteAnim()
|
||||
default:
|
||||
NOT_REACHED();
|
||||
}
|
||||
_pal_count_dirty = 0;
|
||||
_cur_palette.count_dirty = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user