0
0
Fork 0
mirror of https://bitbucket.org/CPMADevs/cnq3 synced 2025-04-14 21:33:01 +00:00

removed superfluous GetVersionEx calls (which is deprecated anyway)

This commit is contained in:
myT 2016-12-30 08:45:21 +01:00
parent 954c80a8b5
commit 161f11e40e

View file

@ -762,14 +762,6 @@ static void GLW_InitExtensions()
}
static qbool GLW_CheckOSVersion()
{
OSVERSIONINFO vinfo;
vinfo.dwOSVersionInfoSize = sizeof(vinfo);
return (qbool)GetVersionEx( &vinfo );
}
static qbool GLW_LoadOpenGL()
{
// only real GL implementations are acceptable
@ -875,24 +867,15 @@ void GLimp_SetGamma( unsigned char red[256], unsigned char green[256], unsigned
table[2][i] = ( ( ( unsigned short ) blue[i] ) << 8 ) | blue[i];
}
// Win2K puts 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 W2K gamma clamp.\n" );
for ( j = 0 ; j < 3 ; j++ ) {
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;
for ( j = 0 ; j < 3 ; j++ ) {
for ( i = 0 ; i < 128 ; i++ ) {
if ( table[j][i] > ( (128+i) << 8 ) ) {
table[j][i] = (128+i) << 8;
}
}
} else {
Com_DPrintf( "skipping W2K gamma clamp.\n" );
if ( table[j][127] > 254<<8 ) {
table[j][127] = 254<<8;
}
}
if ( !SetDeviceGammaRamp( glw_state.hDC, table ) ) {
@ -916,10 +899,6 @@ void GLimp_Init()
{
ri.Printf( PRINT_DEVELOPER, "Initializing OpenGL subsystem\n" );
// check OS version to see if we can do fullscreen display changes
if ( !GLW_CheckOSVersion() )
ri.Error( ERR_FATAL, "GLimp_Init() - incorrect operating system\n" );
// save off hInstance for the subsystems
const cvar_t* cv = ri.Cvar_Get( "win_hinstance", "", 0 );
sscanf( cv->string, "%i", (int *)&g_wv.hInstance );