Last active
March 2, 2019 14:23
-
-
Save nikolas/1bb8c675209d2296a23cc1a395a32a0d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void DrawSurfaceToScreen() | |
{ | |
int n = _num_dirty_rects; | |
if (n == 0) return; | |
_num_dirty_rects = 0; | |
if (n > MAX_DIRTY_RECTS) { | |
if (_sdl_screen != _sdl_realscreen) { | |
SDL_CALL SDL_BlitSurface(_sdl_screen, NULL, _sdl_realscreen, NULL); | |
} | |
SDL_CALL SDL_UpdateRect(_sdl_realscreen, 0, 0, 0, 0); | |
} else { | |
if (_sdl_screen != _sdl_realscreen) { | |
for (int i = 0; i < n; i++) { | |
SDL_CALL SDL_BlitSurface(_sdl_screen, &_dirty_rects[i], _sdl_realscreen, &_dirty_rects[i]); | |
} | |
} | |
SDL_CALL SDL_UpdateRects(_sdl_realscreen, n, _dirty_rects); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment