Codechange: use _cur_palette the same in all the drivers

It was a bit of a mixed bag. With this change, gfx.cpp is in
control who accesses _cur_palette from the video-drivers.
This commit is contained in:
Patric Stout
2021-06-17 10:34:43 +02:00
committed by Patric Stout
parent 1ed7afc0a8
commit 74186998a2
11 changed files with 98 additions and 95 deletions

View File

@@ -146,9 +146,7 @@ bool VideoDriver_SDL_OpenGL::AllocateBackingStore(int w, int h, bool force)
SDL_GL_SwapWindow(this->sdl_window);
_screen.dst_ptr = this->GetVideoPointer();
_cur_palette.first_dirty = 0;
_cur_palette.count_dirty = 256;
this->local_palette = _cur_palette;
CopyPalette(this->local_palette, true);
return res;
}
@@ -173,7 +171,7 @@ void VideoDriver_SDL_OpenGL::Paint()
{
PerformanceMeasurer framerate(PFE_VIDEO);
if (_cur_palette.count_dirty != 0) {
if (this->local_palette.count_dirty != 0) {
Blitter *blitter = BlitterFactory::GetCurrentBlitter();
/* Always push a changed palette to OpenGL. */
@@ -182,7 +180,7 @@ void VideoDriver_SDL_OpenGL::Paint()
blitter->PaletteAnimate(this->local_palette);
}
_cur_palette.count_dirty = 0;
this->local_palette.count_dirty = 0;
}
OpenGLBackend::Get()->Paint();