Remove mask versions of SDL_CreateRGBSurface* #6701 (#6711)

* Rename SDL_CreateRGBSurface{,From} to SDL_CreateSurface{,From}, which now takes a format parameter
This commit is contained in:
Sylvain Becker authored and GitHub committed 2022-12-01 08:04:02 -08:00
1 parent 778b8926b4
commit 932f61348d
36 files changed
+212 -558

No files matched your search

+3 -7
View File
@@ -173,13 +173,9 @@ loadFont(void)
SDL_SetColorKey(surface, 1, SDL_MapRGB(surface->format, 238, 0, 252));
/* now we convert the surface to our desired pixel format */
int format = SDL_PIXELFORMAT_ABGR8888; /* desired texture format */
Uint32 Rmask, Gmask, Bmask, Amask; /* masks for desired format */
int bpp; /* bits per pixel for desired format */
SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask,
&Amask);
SDL_Surface *converted =
SDL_CreateRGBSurface(surface->w, surface->h, bpp, Rmask, Gmask,
Bmask, Amask);
SDL_Surface *converted = SDL_CreateSurface(surface->w, surface->h, format);
SDL_BlitSurface(surface, NULL, converted, NULL);
/* create our texture */
texture = SDL_CreateTextureFromSurface(renderer, converted);