From 551bad82f10df1f79fe16508f131a157e6dbc150 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C4=81nis=20R=C5=ABcis?= Date: Wed, 10 Sep 2008 04:40:20 +0300 Subject: [PATCH] Work around a NULL deref in SDL_SetGammaRamp on MinGW --- src/init.cpp | 2 ++ src/options.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/init.cpp b/src/init.cpp index d0a5ed6..dff77e1 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -263,7 +263,9 @@ void initSystem() Math::limitInt(&game.brightness, 1, 20); float brightness = game.brightness; brightness /= 10; +#if SDL_SETGAMMARAMP_CHECKS_FOR_A_NULL_PALETTE SDL_SetGamma(brightness, brightness, brightness); +#endif } if (TTF_Init() < 0) diff --git a/src/options.cpp b/src/options.cpp index 586a997..90f4ba1 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -372,7 +372,9 @@ void showOptions() brightness = game.brightness; if (brightness > 0) { brightness /= 10; +#if SDL_SETGAMMARAMP_CHECKS_FOR_A_NULL_PALETTE SDL_SetGamma(brightness, brightness, brightness); +#endif } } -- 2.11.4.GIT