From 4db85fcc4d758d8fc299f6540e468ca4e64331f2 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 23 Feb 2012 16:23:09 +0000 Subject: (svn r23978) -Fix: [SDL] Palette update was done too late making switching from 8bpp -> 32bpp look ugly --- src/video/sdl_v.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/video') diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index 663de4ebf..bce7340f6 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -258,9 +258,23 @@ static bool CreateMainSurface(uint w, uint h) _screen.dst_ptr = newscreen->pixels; _sdl_screen = newscreen; - BlitterFactoryBase::GetCurrentBlitter()->PostResize(); + Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter(); + blitter->PostResize(); + + 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; - InitPalette(); + default: + NOT_REACHED(); + } snprintf(caption, sizeof(caption), "OpenTTD %s", _openttd_revision); SDL_CALL SDL_WM_SetCaption(caption, caption); -- cgit v1.2.3-70-g09d2