Skip to content

Commit

Permalink
Name the Pixel Format used for each SDL_Surface created
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl committed Jan 31, 2019
1 parent cc44108 commit 303fee0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SDL_ttf.c
Expand Up @@ -1047,7 +1047,7 @@ static SDL_Surface* Create_Surface_Solid(int width, int height, SDL_Color fg, Ui
pixels = (void *)(((size_t)ptr + sizeof(void *) + alignment) & ~alignment);
((void **)pixels)[-1] = ptr;

textbuf = SDL_CreateRGBSurfaceFrom(pixels, width, height, 8, pitch, 0, 0, 0, 0);
textbuf = SDL_CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, SDL_PIXELFORMAT_INDEX8);
if (textbuf == NULL) {
SDL_free(ptr);
return NULL;
Expand Down Expand Up @@ -1111,7 +1111,7 @@ static SDL_Surface* Create_Surface_Shaded(int width, int height, SDL_Color fg, S
pixels = (void *)(((size_t)ptr + sizeof(void *) + alignment) & ~alignment);
((void **)pixels)[-1] = ptr;

textbuf = SDL_CreateRGBSurfaceFrom(pixels, width, height, 8, pitch, 0, 0, 0, 0);
textbuf = SDL_CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, SDL_PIXELFORMAT_INDEX8);
if (textbuf == NULL) {
SDL_free(ptr);
return NULL;
Expand Down Expand Up @@ -1208,7 +1208,7 @@ static SDL_Surface *Create_Surface_Blended(int width, int height, SDL_Color fg,
pixels = (void *)(((size_t)ptr + sizeof(void *) + alignment) & ~alignment);
((void **)pixels)[-1] = ptr;

textbuf = SDL_CreateRGBSurfaceFrom(pixels, width, height, 32, pitch, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
textbuf = SDL_CreateRGBSurfaceWithFormatFrom(pixels, width, height, 0, pitch, SDL_PIXELFORMAT_ARGB8888);
if (textbuf == NULL) {
SDL_free(ptr);
return NULL;
Expand Down

0 comments on commit 303fee0

Please sign in to comment.