Skip to content

Commit

Permalink
Removed redundant SDL_GetColorKey() call. (thanks Sylvain!)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 26, 2018
1 parent 7f9854b commit 60afec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/render/SDL_render.c
Expand Up @@ -649,7 +649,7 @@ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface)

/* See what the best texture format is */
fmt = surface->format;
if (fmt->Amask || (SDL_HasColorKey(surface) && SDL_GetColorKey(surface, NULL) == 0)) {
if (fmt->Amask || SDL_HasColorKey(surface)) {
needAlpha = SDL_TRUE;
} else {
needAlpha = SDL_FALSE;
Expand Down Expand Up @@ -708,7 +708,7 @@ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface)
SDL_GetSurfaceAlphaMod(surface, &a);
SDL_SetTextureAlphaMod(texture, a);

if (SDL_GetColorKey(surface, NULL) == 0) {
if (SDL_HasColorKey(surface)) {
/* We converted to a texture with alpha format */
SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
} else {
Expand Down

0 comments on commit 60afec7

Please sign in to comment.