foxygit / doom Log in
commit d677f9dcd24d1108927bf422b0cc902152a5a06b
Author:     Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Fri Sep 18 08:25:23 2015 +0200
Commit:     Fabian Greffrath <fabian@greffrath.com>
CommitDate: Fri Sep 18 08:25:23 2015 +0200

    use SDL_LowerBlit() instead of SDL_BlitSurface()

    thanks @bradharding for the suggestion
---
 src/i_video.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/i_video.c b/src/i_video.c
index de001a53..435c79a8 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -158,6 +158,13 @@ static SDL_Surface *rgbabuffer = NULL;
 static SDL_Texture *texture = NULL;
 static SDL_Texture *texture_upscaled = NULL;

+static SDL_Rect blit_rect = {
+    .h = SCREENHEIGHT,
+    .w = SCREENWIDTH,
+    .x = 0,
+    .y = 0,
+};
+
 // palette

 static SDL_Color palette[256];
@@ -1147,7 +1154,7 @@ void I_FinishUpdate (void)
     // Blit from the paletted 8-bit screen buffer to the intermediate
     // 32-bit RGBA buffer that we can load into the texture.

-    SDL_BlitSurface(screenbuffer, NULL, rgbabuffer, NULL);
+    SDL_LowerBlit(screenbuffer, &blit_rect, rgbabuffer, &blit_rect);

     // Update the intermediate texture with the contents of the RGBA buffer.