diff options
Diffstat (limited to 'code/sdl/sdl_gamma.c')
-rw-r--r-- | code/sdl/sdl_gamma.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/code/sdl/sdl_gamma.c b/code/sdl/sdl_gamma.c index 69143cb..2673700 100644 --- a/code/sdl/sdl_gamma.c +++ b/code/sdl/sdl_gamma.c @@ -48,23 +48,25 @@ void GLimp_SetGamma( unsigned char red[256], unsigned char green[256], unsigned #include <windows.h> // Win2K and newer put this odd restriction on gamma ramps... - OSVERSIONINFO vinfo; - - vinfo.dwOSVersionInfoSize = sizeof( vinfo ); - GetVersionEx( &vinfo ); - if( vinfo.dwMajorVersion >= 5 && vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) { - Com_DPrintf( "performing gamma clamp.\n" ); - for( j = 0 ; j < 3 ; j++ ) + OSVERSIONINFO vinfo; + + vinfo.dwOSVersionInfoSize = sizeof( vinfo ); + GetVersionEx( &vinfo ); + if( vinfo.dwMajorVersion >= 5 && vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) { - for( i = 0 ; i < 128 ; i++ ) + Com_DPrintf( "performing gamma clamp.\n" ); + for( j = 0 ; j < 3 ; j++ ) { - if( table[ j ] [ i] > ( ( 128 + i ) << 8 ) ) - table[ j ][ i ] = ( 128 + i ) << 8; - } + for( i = 0 ; i < 128 ; i++ ) + { + if( table[ j ] [ i] > ( ( 128 + i ) << 8 ) ) + table[ j ][ i ] = ( 128 + i ) << 8; + } - if( table[ j ] [127 ] > 254 << 8 ) - table[ j ][ 127 ] = 254 << 8; + if( table[ j ] [127 ] > 254 << 8 ) + table[ j ][ 127 ] = 254 << 8; + } } } #endif |