From dc8e91ec5ecb3c150fba41bc89d6d0b2f6fbbc10 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sun, 1 Jul 2012 17:01:30 +0000 Subject: r_ignorehwgamma 1 does not actually turn on software gamma (#5511) - patch by Serge Belyshev --- src/sdl/sdl_gamma.c | 2 +- src/sdl/sdl_glimp.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/sdl') diff --git a/src/sdl/sdl_gamma.c b/src/sdl/sdl_gamma.c index 7f16b606..53dc4026 100644 --- a/src/sdl/sdl_gamma.c +++ b/src/sdl/sdl_gamma.c @@ -40,7 +40,7 @@ void GLimp_SetGamma( unsigned char red[256], unsigned char green[256], unsigned Uint16 table[3][256]; int i, j; - if( !glConfig.deviceSupportsGamma || r_ignorehwgamma->integer ) + if( !glConfig.deviceSupportsGamma || r_ignorehwgamma->integer > 0 ) return; for (i = 0; i < 256; i++) diff --git a/src/sdl/sdl_glimp.c b/src/sdl/sdl_glimp.c index babbaade..3dadb5b8 100644 --- a/src/sdl/sdl_glimp.c +++ b/src/sdl/sdl_glimp.c @@ -746,6 +746,12 @@ success: // http://bugzilla.icculus.org/show_bug.cgi?id=4316 glConfig.deviceSupportsGamma = SDL_SetGamma( 1.0f, 1.0f, 1.0f ) >= 0; + if ( -1 == r_ignorehwgamma->integer) + glConfig.deviceSupportsGamma = 1; + + if ( 1 == r_ignorehwgamma->integer) + glConfig.deviceSupportsGamma = 0; + // get our config strings Q_strncpyz( glConfig.vendor_string, (char *) qglGetString (GL_VENDOR), sizeof( glConfig.vendor_string ) ); Q_strncpyz( glConfig.renderer_string, (char *) qglGetString (GL_RENDERER), sizeof( glConfig.renderer_string ) ); -- cgit