summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-02-23 16:23:09 +0000
committerrubidium <rubidium@openttd.org>2012-02-23 16:23:09 +0000
commit4db85fcc4d758d8fc299f6540e468ca4e64331f2 (patch)
treefd4c412d7e84036235e3c3320a4f13df15b46384 /src/video
parent37a4acc7e0437aa3f53f77106dd4b366a441cc17 (diff)
downloadopenttd-4db85fcc4d758d8fc299f6540e468ca4e64331f2.tar.xz
(svn r23978) -Fix: [SDL] Palette update was done too late making switching from 8bpp -> 32bpp look ugly
Diffstat (limited to 'src/video')
-rw-r--r--src/video/sdl_v.cpp18
1 files changed, 16 insertions, 2 deletions
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);