Commit 60afec79bf7828d451d7d73a221b42bb835a21a3

Sam Lantinga 2018-09-25T19:53:16

Removed redundant SDL_GetColorKey() call. (thanks Sylvain!)

diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index f8b29d9..07ced0d 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -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;
@@ -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 {