Removed redundant SDL_GetColorKey() call. (thanks Sylvain!)
authorSam Lantinga <slouken@libsdl.org>
Tue, 25 Sep 2018 19:53:16 -0700
changeset 1222390162273424f
parent 12222 09e314140a28
child 12224 0582b4e1fa9f
Removed redundant SDL_GetColorKey() call. (thanks Sylvain!)
src/render/SDL_render.c
     1.1 --- a/src/render/SDL_render.c	Tue Sep 25 01:45:12 2018 -0400
     1.2 +++ b/src/render/SDL_render.c	Tue Sep 25 19:53:16 2018 -0700
     1.3 @@ -649,7 +649,7 @@
     1.4  
     1.5      /* See what the best texture format is */
     1.6      fmt = surface->format;
     1.7 -    if (fmt->Amask || (SDL_HasColorKey(surface) && SDL_GetColorKey(surface, NULL) == 0)) {
     1.8 +    if (fmt->Amask || SDL_HasColorKey(surface)) {
     1.9          needAlpha = SDL_TRUE;
    1.10      } else {
    1.11          needAlpha = SDL_FALSE;
    1.12 @@ -708,7 +708,7 @@
    1.13          SDL_GetSurfaceAlphaMod(surface, &a);
    1.14          SDL_SetTextureAlphaMod(texture, a);
    1.15  
    1.16 -        if (SDL_GetColorKey(surface, NULL) == 0) {
    1.17 +        if (SDL_HasColorKey(surface)) {
    1.18              /* We converted to a texture with alpha format */
    1.19              SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
    1.20          } else {