Mercurial > hg > openttd
changeset 19121:1409c3aa0da5 draft
(svn r23978) -Fix: [SDL] Palette update was done too late making switching from 8bpp -> 32bpp look ugly
author | rubidium <rubidium@openttd.org> |
---|---|
date | Thu, 23 Feb 2012 16:23:09 +0000 |
parents | e97a6b8da2a5 |
children | e8a47fa6143e |
files | src/video/sdl_v.cpp |
diffstat | 1 files changed, 16 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -258,9 +258,23 @@ _screen.dst_ptr = newscreen->pixels; _sdl_screen = newscreen; - BlitterFactoryBase::GetCurrentBlitter()->PostResize(); + Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter(); + blitter->PostResize(); - InitPalette(); + switch (blitter->UsePaletteAnimation()) { + case Blitter::PALETTE_ANIMATION_NONE: + case Blitter::PALETTE_ANIMATION_VIDEO_BACKEND: + InitPalette(); + UpdatePalette(); + break; + + case Blitter::PALETTE_ANIMATION_BLITTER: + blitter->PaletteAnimate(_local_palette); + break; + + default: + NOT_REACHED(); + } snprintf(caption, sizeof(caption), "OpenTTD %s", _openttd_revision); SDL_CALL SDL_WM_SetCaption(caption, caption);