From 13302cc133cbb8e4bbc4a79ff2057e64db8a86bb Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sun, 28 Mar 2010 18:33:35 +0000 Subject: [PATCH] Disable visible warnings when gamma-setting fails. Fixes #480. This was SVN commit r7410. --- source/lib/sysdep/os/win/wsdl.cpp | 4 +++- source/ps/GameSetup/GameSetup.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/lib/sysdep/os/win/wsdl.cpp b/source/lib/sysdep/os/win/wsdl.cpp index dbc2896638..311e26536c 100644 --- a/source/lib/sysdep/os/win/wsdl.cpp +++ b/source/lib/sysdep/os/win/wsdl.cpp @@ -141,7 +141,9 @@ private: SetLastError(0); debug_assert(wutil_IsValidHandle(g_hDC)); const BOOL ok = SetDeviceGammaRamp(g_hDC, ramps); - debug_assert(ok); + // The call often fails, especially on multi-monitor systems, and we don't + // know how to fix/avoid the underlying problem, so just ignore the failure here + //debug_assert(ok); return !!ok; } diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index 8dfa78c80d..70471eebc2 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -139,7 +139,7 @@ static int SetVideoMode(int w, int h, int bpp, bool fullscreen) ogl_Init(); // required after each mode change if(SDL_SetGamma(g_Gamma, g_Gamma, g_Gamma) < 0) - debug_warn(L"SDL_SetGamma failed"); + LOGWARNING(L"SDL_SetGamma failed"); return 0; }