Fix data race during palette animation with threaded blitters
This commit is contained in:
@@ -513,6 +513,7 @@ void VideoDriver_Allegro::MainLoop()
|
||||
if (old_shift_pressed != _shift_pressed) HandleShiftChanged();
|
||||
|
||||
GameLoop();
|
||||
GameLoopPaletteAnimations();
|
||||
|
||||
UpdateWindows();
|
||||
CheckPaletteAnim();
|
||||
|
||||
@@ -654,7 +654,10 @@ void QZ_GameLoop()
|
||||
_cocoa_subdriver->Draw(true);
|
||||
CSleep(1);
|
||||
|
||||
for (int i = 0; i < 2; i++) GameLoop();
|
||||
for (int i = 0; i < 2; i++) {
|
||||
GameLoop();
|
||||
GameLoopPaletteAnimations();
|
||||
}
|
||||
|
||||
UpdateWindows();
|
||||
QZ_CheckPaletteAnim();
|
||||
@@ -702,6 +705,7 @@ void QZ_GameLoop()
|
||||
if (old_shift_pressed != _shift_pressed) HandleShiftChanged();
|
||||
|
||||
GameLoop();
|
||||
GameLoopPaletteAnimations();
|
||||
|
||||
UpdateWindows();
|
||||
QZ_CheckPaletteAnim();
|
||||
|
||||
@@ -299,6 +299,7 @@ void VideoDriver_Dedicated::MainLoop()
|
||||
next_tick = cur_ticks + MILLISECONDS_PER_TICK;
|
||||
|
||||
GameLoop();
|
||||
GameLoopPaletteAnimations();
|
||||
UpdateWindows();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,11 +48,13 @@ void VideoDriver_Null::MainLoop()
|
||||
if (this->until_exit) {
|
||||
while (!_exit_game) {
|
||||
GameLoop();
|
||||
GameLoopPaletteAnimations();
|
||||
UpdateWindows();
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < this->ticks; i++) {
|
||||
GameLoop();
|
||||
GameLoopPaletteAnimations();
|
||||
UpdateWindows();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1087,6 +1087,8 @@ void VideoDriver_SDL::MainLoop()
|
||||
|
||||
if (_draw_mutex != nullptr) draw_lock.lock();
|
||||
|
||||
GameLoopPaletteAnimations();
|
||||
|
||||
UpdateWindows();
|
||||
_local_palette = _cur_palette;
|
||||
} else {
|
||||
|
||||
@@ -755,6 +755,8 @@ void VideoDriver_SDL::MainLoop()
|
||||
|
||||
if (_draw_mutex != nullptr) draw_lock.lock();
|
||||
|
||||
GameLoopPaletteAnimations();
|
||||
|
||||
UpdateWindows();
|
||||
_local_palette = _cur_palette;
|
||||
} else {
|
||||
|
||||
@@ -1268,6 +1268,7 @@ void VideoDriver_Win32::MainLoop()
|
||||
if (_draw_threaded) draw_lock.unlock();
|
||||
GameLoop();
|
||||
if (_draw_threaded) draw_lock.lock();
|
||||
GameLoopPaletteAnimations();
|
||||
|
||||
if (_force_full_redraw) MarkWholeScreenDirty();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user