[Commits] SDL: Removed redundant SDL_GetColorKey() call. (thanks Sylvain!)

libsdl.org revision control commits-owner at libsdl.org
Tue Sep 25 19:53:42 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/90162273424f
changeset: 12223:90162273424f
user:      Sam Lantinga <slouken at libsdl.org>
date:      Tue Sep 25 19:53:16 2018 -0700
description:
Removed redundant SDL_GetColorKey() call. (thanks Sylvain!)

diffstat:

 src/render/SDL_render.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 09e314140a28 -r 90162273424f src/render/SDL_render.c
--- a/src/render/SDL_render.c	Tue Sep 25 01:45:12 2018 -0400
+++ b/src/render/SDL_render.c	Tue Sep 25 19:53:16 2018 -0700
@@ -649,7 +649,7 @@
 
     /* 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_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 {


More information about the commits mailing list