(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)
This commit is contained in:
@@ -100,7 +100,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:
|
||||
@@ -487,7 +487,8 @@ void VideoDriver_Allegro::MainLoop()
|
||||
uint32 cur_ticks = GetTime();
|
||||
uint32 last_cur_ticks = cur_ticks;
|
||||
uint32 next_tick = cur_ticks + MILLISECONDS_PER_TICK;
|
||||
uint32 pal_tick = 0;
|
||||
|
||||
CheckPaletteAnim();
|
||||
|
||||
for (;;) {
|
||||
uint32 prev_cur_ticks = cur_ticks; // to check for wrapping
|
||||
@@ -532,10 +533,7 @@ void VideoDriver_Allegro::MainLoop()
|
||||
GameLoop();
|
||||
|
||||
UpdateWindows();
|
||||
if (++pal_tick > 4) {
|
||||
CheckPaletteAnim();
|
||||
pal_tick = 1;
|
||||
}
|
||||
CheckPaletteAnim();
|
||||
DrawSurfaceToScreen();
|
||||
} else {
|
||||
CSleep(1);
|
||||
|
@@ -99,7 +99,7 @@ static void QZ_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:
|
||||
@@ -555,7 +555,6 @@ void QZ_GameLoop()
|
||||
uint32 cur_ticks = GetTick();
|
||||
uint32 last_cur_ticks = cur_ticks;
|
||||
uint32 next_tick = cur_ticks + MILLISECONDS_PER_TICK;
|
||||
uint32 pal_tick = 0;
|
||||
|
||||
#ifdef _DEBUG
|
||||
uint32 et0 = GetTick();
|
||||
@@ -615,10 +614,7 @@ void QZ_GameLoop()
|
||||
GameLoop();
|
||||
|
||||
UpdateWindows();
|
||||
if (++pal_tick > 4) {
|
||||
QZ_CheckPaletteAnim();
|
||||
pal_tick = 1;
|
||||
}
|
||||
QZ_CheckPaletteAnim();
|
||||
_cocoa_subdriver->Draw();
|
||||
} else {
|
||||
#ifdef _DEBUG
|
||||
|
@@ -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();
|
||||
|
@@ -359,7 +359,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||
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:
|
||||
@@ -853,6 +853,7 @@ void VideoDriver_Win32::MainLoop()
|
||||
|
||||
_wnd.running = true;
|
||||
|
||||
CheckPaletteAnim();
|
||||
for (;;) {
|
||||
uint32 prev_cur_ticks = cur_ticks; // to check for wrapping
|
||||
|
||||
|
Reference in New Issue
Block a user