aboutsummaryrefslogtreecommitdiffstats
path: root/code/sdl
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-10-01 07:56:32 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-10-01 07:56:32 +0000
commit89f707ad9cefdebda05d6f019f584be159f740a7 (patch)
treea768e27e64d0e1ebae36bd0c775df425fa5a3fbe /code/sdl
parent3be58475077ded26b1e8b8c0b3f890e11fc9d0e1 (diff)
downloadioquake3-aero-89f707ad9cefdebda05d6f019f584be159f740a7.tar.gz
ioquake3-aero-89f707ad9cefdebda05d6f019f584be159f740a7.zip
* Remove some C99isms (f0rqu3)
* Provide Q_snprintf wrapper for snprintf (f0rqu3) git-svn-id: svn://svn.icculus.org/quake3/trunk@1188 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/sdl')
-rw-r--r--code/sdl/sdl_gamma.c28
-rw-r--r--code/sdl/sdl_glimp.c2
2 files changed, 16 insertions, 14 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
diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c
index c2a187a..5befe19 100644
--- a/code/sdl/sdl_glimp.c
+++ b/code/sdl/sdl_glimp.c
@@ -115,6 +115,7 @@ static int GLimp_SetMode( int mode, qboolean fullscreen )
int tcolorbits, tdepthbits, tstencilbits;
int i = 0;
SDL_Surface *vidscreen = NULL;
+ Uint32 flags = SDL_OPENGL;
ri.Printf( PRINT_ALL, "Initializing OpenGL display\n");
@@ -127,7 +128,6 @@ static int GLimp_SetMode( int mode, qboolean fullscreen )
}
ri.Printf( PRINT_ALL, " %d %d\n", glConfig.vidWidth, glConfig.vidHeight);
- Uint32 flags = SDL_OPENGL;
if (fullscreen)
{
flags |= SDL_FULLSCREEN;