summaryrefslogtreecommitdiff
path: root/src/video/sdl_v.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-12-08 19:37:33 +0000
committerrubidium <rubidium@openttd.org>2011-12-08 19:37:33 +0000
commit61625e53c96572528745b79a63ba614b74c8f301 (patch)
treef748a6f1eb557f7466346597b167607d1ae75413 /src/video/sdl_v.cpp
parent8630e97b4f0d078ca492944f383790979b85f8c1 (diff)
downloadopenttd-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/video/sdl_v.cpp')
-rw-r--r--src/video/sdl_v.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 1b579cc51..e56d2730f 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -85,7 +85,7 @@ static void CheckPaletteAnim()
break;
case Blitter::PALETTE_ANIMATION_BLITTER:
- blitter->PaletteAnimate(_cur_palette.first_dirty, _cur_palette.count_dirty);
+ blitter->PaletteAnimate(_cur_palette);
break;
case Blitter::PALETTE_ANIMATION_NONE:
@@ -503,11 +503,12 @@ void VideoDriver_SDL::MainLoop()
uint32 cur_ticks = SDL_CALL SDL_GetTicks();
uint32 last_cur_ticks = cur_ticks;
uint32 next_tick = cur_ticks + MILLISECONDS_PER_TICK;
- uint32 pal_tick = 0;
uint32 mod;
int numkeys;
Uint8 *keys;
+ CheckPaletteAnim();
+
if (_draw_threaded) {
/* Initialise the mutex first, because that's the thing we *need*
* directly in the newly created thread. */
@@ -584,10 +585,7 @@ void VideoDriver_SDL::MainLoop()
if (_draw_threaded) _draw_mutex->BeginCritical();
UpdateWindows();
- if (++pal_tick > 4) {
- CheckPaletteAnim();
- pal_tick = 1;
- }
+ CheckPaletteAnim();
} else {
/* Release the thread while sleeping */
if (_draw_threaded) _draw_mutex->EndCritical();