From 9f193f123e5105585cabf8e2d2d95c5b49ce6389 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Fri, 3 Apr 2020 18:27:40 -0700 Subject: [PATCH] Backfit commit 'c0bc500620' to SDL1/2: "Added gamma correction option to the setup menu; bug #977; some work from Nic" --- sc2/src/libs/graphics/sdl/sdl1_common.c | 11 ++--------- sc2/src/libs/graphics/sdl/sdl2_common.c | 1 + 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sc2/src/libs/graphics/sdl/sdl1_common.c b/sc2/src/libs/graphics/sdl/sdl1_common.c index 96f68f7ef..f5c7c2246 100644 --- a/sc2/src/libs/graphics/sdl/sdl1_common.c +++ b/sc2/src/libs/graphics/sdl/sdl1_common.c @@ -110,17 +110,10 @@ TFB_ReInitGraphics (int driver, int flags, int width, int height) return result; } -void +bool TFB_SetGamma (float gamma) { - if (SDL_SetGamma (gamma, gamma, gamma) == -1) - { - log_add (log_Warning, "Unable to set gamma correction."); - } - else - { - log_add (log_Info, "Gamma correction set to %1.4f.", gamma); - } + return (SDL_SetGamma (gamma, gamma, gamma) == 0); } int diff --git a/sc2/src/libs/graphics/sdl/sdl2_common.c b/sc2/src/libs/graphics/sdl/sdl2_common.c index 74f7541cd..11e4a9c9b 100644 --- a/sc2/src/libs/graphics/sdl/sdl2_common.c +++ b/sc2/src/libs/graphics/sdl/sdl2_common.c @@ -94,6 +94,7 @@ void TFB_SetGamma (float gamma) { log_add (log_Warning, "Custom gamma correction is not available in the SDL2 engine."); + return 0; } int