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:
parent
fc9de58302
commit
ae46a5b3b0
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue