shithub: cstory

Download patch

ref: 2e8d3441edcdf787aabf7e0c35616abbb486c523
parent: 0ed19894ba3b631ada32cf5c224ed518ac594a43
author: Clownacy <[email protected]>
date: Sat Jan 4 14:49:43 EST 2020

Turns out I'm the stupid one

--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -37,8 +37,6 @@
 
 static Backend_Surface *surf[SURFACE_ID_MAX];
 
-static SDL_PixelFormat *rgb24_pixel_format;	// Needed because SDL2 is stupid
-
 static FontObject *font;
 
 // This doesn't exist in the Linux port, so none of these symbol names are accurate
@@ -122,8 +120,6 @@
 	if (framebuffer == NULL)
 		return FALSE;
 
-	rgb24_pixel_format = SDL_AllocFormat(SDL_PIXELFORMAT_RGB24);
-
 	return TRUE;
 }
 
@@ -143,8 +139,6 @@
 
 	framebuffer = NULL;
 
-	SDL_FreeFormat(rgb24_pixel_format);
-
 	Backend_Deinit();
 
 	memset(surface_metadata, 0, sizeof(surface_metadata));
@@ -164,7 +158,7 @@
 
 static BOOL ScaleAndUploadSurface(SDL_Surface *surface, SurfaceID surf_no)
 {
-	SDL_Surface *converted_surface = SDL_ConvertSurface(surface, rgb24_pixel_format, 0);
+	SDL_Surface *converted_surface = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_RGB24, 0);
 
 	SDL_FreeSurface(surface);