| 89 | } |
| 90 | |
| 91 | void VideoDriver_SDL_Default::Paint() |
| 92 | { |
| 93 | PerformanceMeasurer framerate(PFE_VIDEO); |
| 94 | |
| 95 | if (IsEmptyRect(this->dirty_rect) && this->local_palette.count_dirty == 0) return; |
| 96 | |
| 97 | if (this->local_palette.count_dirty != 0) { |
| 98 | Blitter *blitter = BlitterFactory::GetCurrentBlitter(); |
| 99 | |
| 100 | switch (blitter->UsePaletteAnimation()) { |
| 101 | case Blitter::PaletteAnimation::VideoBackend: |
| 102 | this->UpdatePalette(); |
| 103 | break; |
| 104 | |
| 105 | case Blitter::PaletteAnimation::Blitter: { |
| 106 | blitter->PaletteAnimate(this->local_palette); |
| 107 | break; |
| 108 | } |
| 109 | |
| 110 | case Blitter::PaletteAnimation::None: |
| 111 | break; |
| 112 | |
| 113 | default: |
| 114 | NOT_REACHED(); |
| 115 | } |
| 116 | this->local_palette.count_dirty = 0; |
| 117 | } |
| 118 | |
| 119 | SDL_Rect r = { this->dirty_rect.left, this->dirty_rect.top, this->dirty_rect.right - this->dirty_rect.left, this->dirty_rect.bottom - this->dirty_rect.top }; |
| 120 | |
| 121 | if (_sdl_surface != _sdl_real_surface) { |
| 122 | SDL_BlitSurface(_sdl_surface, &r, _sdl_real_surface, &r); |
| 123 | } |
| 124 | SDL_UpdateWindowSurfaceRects(this->sdl_window, &r, 1); |
| 125 | |
| 126 | this->dirty_rect = {}; |
| 127 | } |
| 128 | |
| 129 | bool VideoDriver_SDL_Default::AllocateBackingStore(int w, int h, bool force) |
| 130 | { |
nothing calls this directly
no test coverage detected