shithub: choc

Download patch

ref: d677f9dcd24d1108927bf422b0cc902152a5a06b
parent: a9173b09d799006ab09e3def8c4b43b6b8668c1a
author: Fabian Greffrath <[email protected]>
date: Fri Sep 18 04:25:23 EDT 2015

use SDL_LowerBlit() instead of SDL_BlitSurface()

thanks @bradharding for the suggestion

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -158,6 +158,13 @@
 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 @@
     // 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.