Simplify SDL gr_flip: nullptr implies copy all

Per the header comments, passing nullptr for source or destination
copies the entire region.  Use that instead of explicitly requesting the
entire region.  This should be more efficient, since it bypasses the
source rectangle clipping code that SDL would otherwise run.
This commit is contained in:
Kp 2022-11-06 18:18:57 +00:00
parent fc9de58302
commit ae46a5b3b0
1 changed files with 1 additions and 7 deletions

View File

@ -43,13 +43,7 @@ static int gr_installed;
void gr_flip()
{
SDL_Rect src, dest;
dest.x = src.x = dest.y = src.y = 0;
dest.w = src.w = canvas->w;
dest.h = src.h = canvas->h;
SDL_BlitSurface(canvas, &src, screen, &dest);
SDL_BlitSurface(canvas, nullptr, screen, nullptr);
SDL_Flip(screen);
}