Remove graphic presets from menu

This commit is contained in:
Petr Bartos 2022-03-29 21:52:14 +02:00
parent 1e7279b899
commit 90fa0bcf42
4 changed files with 348 additions and 345 deletions

View file

@ -383,99 +383,99 @@ static qboolean resolutionsDetected = qfalse;
GraphicsOptions_FindBuiltinResolution
=================
*/
static int GraphicsOptions_FindBuiltinResolution( int mode )
{
int i;
if( !resolutionsDetected )
return mode;
if( mode < 0 )
return -1;
for( i = 0; builtinResolutions[ i ]; i++ )
{
if( !Q_stricmp( builtinResolutions[ i ], detectedResolutions[ mode ] ) )
return i;
}
return -1;
}
// static int GraphicsOptions_FindBuiltinResolution( int mode )
// {
// int i;
//
// if( !resolutionsDetected )
// return mode;
//
// if( mode < 0 )
// return -1;
//
// for( i = 0; builtinResolutions[ i ]; i++ )
// {
// if( !Q_stricmp( builtinResolutions[ i ], detectedResolutions[ mode ] ) )
// return i;
// }
//
// return -1;
// }
/*
=================
GraphicsOptions_FindDetectedResolution
=================
*/
static int GraphicsOptions_FindDetectedResolution( int mode )
{
int i;
if( !resolutionsDetected )
return mode;
if( mode < 0 )
return -1;
for( i = 0; detectedResolutions[ i ]; i++ )
{
if( !Q_stricmp( builtinResolutions[ mode ], detectedResolutions[ i ] ) )
return i;
}
return -1;
}
// static int GraphicsOptions_FindDetectedResolution( int mode )
// {
// int i;
//
// if( !resolutionsDetected )
// return mode;
//
// if( mode < 0 )
// return -1;
//
// for( i = 0; detectedResolutions[ i ]; i++ )
// {
// if( !Q_stricmp( builtinResolutions[ mode ], detectedResolutions[ i ] ) )
// return i;
// }
//
// return -1;
// }
/*
=================
GraphicsOptions_GetAspectRatios
=================
*/
static void GraphicsOptions_GetAspectRatios( void )
{
int i, r;
// build ratio list from resolutions
for( r = 0; resolutions[r]; r++ )
{
int w, h;
char *x;
char str[ sizeof(ratioBuf[0]) ];
// calculate resolution's aspect ratio
x = strchr( resolutions[r], 'x' ) + 1;
Q_strncpyz( str, resolutions[r], x-resolutions[r] );
w = atoi( str );
h = atoi( x );
Com_sprintf( str, sizeof(str), "%.2f:1", (float)w / (float)h );
// rename common ratios ("1.33:1" -> "4:3")
for( i = 0; knownRatios[i][0]; i++ ) {
if( !Q_stricmp( str, knownRatios[i][0] ) ) {
Q_strncpyz( str, knownRatios[i][1], sizeof( str ) );
break;
}
}
// add ratio to list if it is new
// establish res/ratio relationship
for( i = 0; ratioBuf[i][0]; i++ )
{
if( !Q_stricmp( str, ratioBuf[i] ) )
break;
}
if( !ratioBuf[i][0] )
{
Q_strncpyz( ratioBuf[i], str, sizeof(ratioBuf[i]) );
ratioToRes[i] = r;
}
ratios[r] = ratioBuf[r];
resToRatio[r] = i;
}
ratios[r] = NULL;
}
// static void GraphicsOptions_GetAspectRatios( void )
// {
// int i, r;
//
// // build ratio list from resolutions
// for( r = 0; resolutions[r]; r++ )
// {
// int w, h;
// char *x;
// char str[ sizeof(ratioBuf[0]) ];
//
// // calculate resolution's aspect ratio
// x = strchr( resolutions[r], 'x' ) + 1;
// Q_strncpyz( str, resolutions[r], x-resolutions[r] );
// w = atoi( str );
// h = atoi( x );
// Com_sprintf( str, sizeof(str), "%.2f:1", (float)w / (float)h );
//
// // rename common ratios ("1.33:1" -> "4:3")
// for( i = 0; knownRatios[i][0]; i++ ) {
// if( !Q_stricmp( str, knownRatios[i][0] ) ) {
// Q_strncpyz( str, knownRatios[i][1], sizeof( str ) );
// break;
// }
// }
//
// // add ratio to list if it is new
// // establish res/ratio relationship
// for( i = 0; ratioBuf[i][0]; i++ )
// {
// if( !Q_stricmp( str, ratioBuf[i] ) )
// break;
// }
// if( !ratioBuf[i][0] )
// {
// Q_strncpyz( ratioBuf[i], str, sizeof(ratioBuf[i]) );
// ratioToRes[i] = r;
// }
//
// ratios[r] = ratioBuf[r];
// resToRatio[r] = i;
// }
//
// ratios[r] = NULL;
// }
/*
=================
@ -485,10 +485,10 @@ GraphicsOptions_GetInitialVideo
static void GraphicsOptions_GetInitialVideo( void )
{
s_ivo.colordepth = s_graphicsoptions.colordepth.curvalue;
s_ivo.driver = s_graphicsoptions.driver.curvalue;
s_ivo.mode = s_graphicsoptions.mode.curvalue;
s_ivo.fullscreen = s_graphicsoptions.fs.curvalue;
s_ivo.extensions = s_graphicsoptions.allow_extensions.curvalue;
// s_ivo.driver = s_graphicsoptions.driver.curvalue;
// s_ivo.mode = s_graphicsoptions.mode.curvalue;
// s_ivo.fullscreen = s_graphicsoptions.fs.curvalue;
// s_ivo.extensions = s_graphicsoptions.allow_extensions.curvalue;
s_ivo.tq = s_graphicsoptions.tq.curvalue;
s_ivo.lighting = s_graphicsoptions.lighting.curvalue;
s_ivo.geometry = s_graphicsoptions.geometry.curvalue;
@ -505,81 +505,81 @@ static void GraphicsOptions_GetInitialVideo( void )
GraphicsOptions_GetResolutions
=================
*/
static void GraphicsOptions_GetResolutions( void )
{
trap_Cvar_VariableStringBuffer("r_availableModes", resbuf, sizeof(resbuf));
if(*resbuf)
{
char* s = resbuf;
unsigned int i = 0;
while( s && i < ARRAY_LEN(detectedResolutions)-1 )
{
detectedResolutions[i++] = s;
s = strchr(s, ' ');
if( s )
*s++ = '\0';
}
detectedResolutions[ i ] = NULL;
// add custom resolution if not in mode list
if ( i < ARRAY_LEN(detectedResolutions)-1 )
{
Com_sprintf( currentResolution, sizeof ( currentResolution ), "%dx%d", uis.glconfig.vidWidth, uis.glconfig.vidHeight );
for( i = 0; detectedResolutions[ i ]; i++ )
{
if ( strcmp( detectedResolutions[ i ], currentResolution ) == 0 )
break;
}
if ( detectedResolutions[ i ] == NULL )
{
detectedResolutions[ i++ ] = currentResolution;
detectedResolutions[ i ] = NULL;
}
}
resolutions = detectedResolutions;
resolutionsDetected = qtrue;
}
}
// static void GraphicsOptions_GetResolutions( void )
// {
// trap_Cvar_VariableStringBuffer("r_availableModes", resbuf, sizeof(resbuf));
// if(*resbuf)
// {
// char* s = resbuf;
// unsigned int i = 0;
// while( s && i < ARRAY_LEN(detectedResolutions)-1 )
// {
// detectedResolutions[i++] = s;
// s = strchr(s, ' ');
// if( s )
// *s++ = '\0';
// }
// detectedResolutions[ i ] = NULL;
//
// // add custom resolution if not in mode list
// if ( i < ARRAY_LEN(detectedResolutions)-1 )
// {
// Com_sprintf( currentResolution, sizeof ( currentResolution ), "%dx%d", uis.glconfig.vidWidth, uis.glconfig.vidHeight );
//
// for( i = 0; detectedResolutions[ i ]; i++ )
// {
// if ( strcmp( detectedResolutions[ i ], currentResolution ) == 0 )
// break;
// }
//
// if ( detectedResolutions[ i ] == NULL )
// {
// detectedResolutions[ i++ ] = currentResolution;
// detectedResolutions[ i ] = NULL;
// }
// }
//
// resolutions = detectedResolutions;
// resolutionsDetected = qtrue;
// }
// }
/*
=================
GraphicsOptions_CheckConfig
=================
*/
static void GraphicsOptions_CheckConfig( void )
{
int i;
for ( i = 0; i < NUM_IVO_TEMPLATES-1; i++ )
{
if ( s_ivo_templates[i].colordepth != s_graphicsoptions.colordepth.curvalue )
continue;
if ( s_ivo_templates[i].driver != s_graphicsoptions.driver.curvalue )
continue;
if ( GraphicsOptions_FindDetectedResolution(s_ivo_templates[i].mode) != s_graphicsoptions.mode.curvalue )
continue;
if ( s_ivo_templates[i].fullscreen != s_graphicsoptions.fs.curvalue )
continue;
if ( s_ivo_templates[i].tq != s_graphicsoptions.tq.curvalue )
continue;
if ( s_ivo_templates[i].lighting != s_graphicsoptions.lighting.curvalue )
continue;
if ( s_ivo_templates[i].geometry != s_graphicsoptions.geometry.curvalue )
continue;
if ( s_ivo_templates[i].filter != s_graphicsoptions.filter.curvalue )
continue;
// static void GraphicsOptions_CheckConfig( void )
// {
// int i;
//
// for ( i = 0; i < NUM_IVO_TEMPLATES-1; i++ )
// {
// if ( s_ivo_templates[i].colordepth != s_graphicsoptions.colordepth.curvalue )
// continue;
// if ( s_ivo_templates[i].driver != s_graphicsoptions.driver.curvalue )
// continue;
// if ( GraphicsOptions_FindDetectedResolution(s_ivo_templates[i].mode) != s_graphicsoptions.mode.curvalue )
// continue;
// if ( s_ivo_templates[i].fullscreen != s_graphicsoptions.fs.curvalue )
// continue;
// if ( s_ivo_templates[i].tq != s_graphicsoptions.tq.curvalue )
// continue;
// if ( s_ivo_templates[i].lighting != s_graphicsoptions.lighting.curvalue )
// continue;
// if ( s_ivo_templates[i].geometry != s_graphicsoptions.geometry.curvalue )
// continue;
// if ( s_ivo_templates[i].filter != s_graphicsoptions.filter.curvalue )
// continue;
// if ( s_ivo_templates[i].texturebits != s_graphicsoptions.texturebits.curvalue )
// continue;
s_graphicsoptions.list.curvalue = i;
return;
}
// return 'Custom' ivo template
s_graphicsoptions.list.curvalue = NUM_IVO_TEMPLATES - 1;
}
// s_graphicsoptions.list.curvalue = i;
// return;
// }
//
// // return 'Custom' ivo template
// s_graphicsoptions.list.curvalue = NUM_IVO_TEMPLATES - 1;
// }
/*
=================
@ -588,49 +588,49 @@ GraphicsOptions_UpdateMenuItems
*/
static void GraphicsOptions_UpdateMenuItems( void )
{
if ( s_graphicsoptions.driver.curvalue == 1 )
{
s_graphicsoptions.fs.curvalue = 1;
s_graphicsoptions.fs.generic.flags |= QMF_GRAYED;
s_graphicsoptions.colordepth.curvalue = 1;
}
else
{
s_graphicsoptions.fs.generic.flags &= ~QMF_GRAYED;
}
// if ( s_graphicsoptions.driver.curvalue == 1 )
// {
// s_graphicsoptions.fs.curvalue = 1;
// s_graphicsoptions.fs.generic.flags |= QMF_GRAYED;
// s_graphicsoptions.colordepth.curvalue = 1;
// }
// else
// {
// s_graphicsoptions.fs.generic.flags &= ~QMF_GRAYED;
// }
if ( s_graphicsoptions.fs.curvalue == 0 || s_graphicsoptions.driver.curvalue == 1 )
{
s_graphicsoptions.colordepth.curvalue = 0;
s_graphicsoptions.colordepth.generic.flags |= QMF_GRAYED;
}
else
{
s_graphicsoptions.colordepth.generic.flags &= ~QMF_GRAYED;
}
// if ( s_graphicsoptions.fs.curvalue == 0 || s_graphicsoptions.driver.curvalue == 1 )
// {
// s_graphicsoptions.colordepth.curvalue = 0;
// s_graphicsoptions.colordepth.generic.flags |= QMF_GRAYED;
// }
// else
// {
// s_graphicsoptions.colordepth.generic.flags &= ~QMF_GRAYED;
// }
if ( s_graphicsoptions.allow_extensions.curvalue == 0 )
{
if ( s_graphicsoptions.texturebits.curvalue == 0 )
{
s_graphicsoptions.texturebits.curvalue = 1;
}
}
// if ( s_graphicsoptions.allow_extensions.curvalue == 0 )
// {
// if ( s_graphicsoptions.texturebits.curvalue == 0 )
// {
// s_graphicsoptions.texturebits.curvalue = 1;
// }
// }
s_graphicsoptions.apply.generic.flags |= QMF_HIDDEN|QMF_INACTIVE;
if ( s_ivo.mode != s_graphicsoptions.mode.curvalue )
{
s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
}
if ( s_ivo.fullscreen != s_graphicsoptions.fs.curvalue )
{
s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
}
if ( s_ivo.extensions != s_graphicsoptions.allow_extensions.curvalue )
{
s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
}
// if ( s_ivo.mode != s_graphicsoptions.mode.curvalue )
// {
// s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
// }
// if ( s_ivo.fullscreen != s_graphicsoptions.fs.curvalue )
// {
// s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
// }
// if ( s_ivo.extensions != s_graphicsoptions.allow_extensions.curvalue )
// {
// s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
// }
if ( s_ivo.tq != s_graphicsoptions.tq.curvalue )
{
s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
@ -643,10 +643,10 @@ static void GraphicsOptions_UpdateMenuItems( void )
{
s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
}
if ( s_ivo.driver != s_graphicsoptions.driver.curvalue )
{
s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
}
// if ( s_ivo.driver != s_graphicsoptions.driver.curvalue )
// {
// s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
// }
if ( s_ivo.texturebits != s_graphicsoptions.texturebits.curvalue )
{
s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
@ -660,8 +660,8 @@ static void GraphicsOptions_UpdateMenuItems( void )
s_graphicsoptions.apply.generic.flags &= ~(QMF_HIDDEN|QMF_INACTIVE);
}
GraphicsOptions_CheckConfig();
}
// GraphicsOptions_CheckConfig();
}
/*
=================
@ -686,34 +686,36 @@ static void GraphicsOptions_ApplyChanges( void *unused, int notification )
break;
}
trap_Cvar_SetValue( "r_picmip", 3 - s_graphicsoptions.tq.curvalue );
trap_Cvar_SetValue( "r_allowExtensions", s_graphicsoptions.allow_extensions.curvalue );
if( resolutionsDetected )
{
// search for builtin mode that matches the detected mode
int mode;
if ( s_graphicsoptions.mode.curvalue == -1
|| s_graphicsoptions.mode.curvalue >= ARRAY_LEN( detectedResolutions ) )
s_graphicsoptions.mode.curvalue = 0;
// trap_Cvar_SetValue( "r_allowExtensions", s_graphicsoptions.allow_extensions.curvalue );
mode = GraphicsOptions_FindBuiltinResolution( s_graphicsoptions.mode.curvalue );
if( mode == -1 )
{
char w[ 16 ], h[ 16 ];
Q_strncpyz( w, detectedResolutions[ s_graphicsoptions.mode.curvalue ], sizeof( w ) );
*strchr( w, 'x' ) = 0;
Q_strncpyz( h,
strchr( detectedResolutions[ s_graphicsoptions.mode.curvalue ], 'x' ) + 1, sizeof( h ) );
trap_Cvar_Set( "r_customwidth", w );
trap_Cvar_Set( "r_customheight", h );
}
// if( resolutionsDetected )
// {
// // search for builtin mode that matches the detected mode
// int mode;
// if ( s_graphicsoptions.mode.curvalue == -1
// || s_graphicsoptions.mode.curvalue >= ARRAY_LEN( detectedResolutions ) )
// s_graphicsoptions.mode.curvalue = 0;
//
// mode = GraphicsOptions_FindBuiltinResolution( s_graphicsoptions.mode.curvalue );
// if( mode == -1 )
// {
// char w[ 16 ], h[ 16 ];
// Q_strncpyz( w, detectedResolutions[ s_graphicsoptions.mode.curvalue ], sizeof( w ) );
// *strchr( w, 'x' ) = 0;
// Q_strncpyz( h,
// strchr( detectedResolutions[ s_graphicsoptions.mode.curvalue ], 'x' ) + 1, sizeof( h ) );
// trap_Cvar_Set( "r_customwidth", w );
// trap_Cvar_Set( "r_customheight", h );
// }
//
// trap_Cvar_SetValue( "r_mode", mode );
// }
// else
// trap_Cvar_SetValue( "r_mode", s_graphicsoptions.mode.curvalue );
trap_Cvar_SetValue( "r_mode", mode );
}
else
trap_Cvar_SetValue( "r_mode", s_graphicsoptions.mode.curvalue );
// trap_Cvar_SetValue( "r_fullscreen", s_graphicsoptions.fs.curvalue );
trap_Cvar_SetValue( "r_fullscreen", s_graphicsoptions.fs.curvalue );
switch ( s_graphicsoptions.colordepth.curvalue )
{
case 0:
@ -732,6 +734,7 @@ static void GraphicsOptions_ApplyChanges( void *unused, int notification )
trap_Cvar_SetValue( "r_stencilbits", 8 );
break;
}
trap_Cvar_SetValue( "r_vertexLight", s_graphicsoptions.lighting.curvalue );
if ( s_graphicsoptions.geometry.curvalue == 2 )
@ -748,7 +751,7 @@ static void GraphicsOptions_ApplyChanges( void *unused, int notification )
{
trap_Cvar_SetValue( "r_lodBias", 2 );
trap_Cvar_SetValue( "r_subdivisions", 20 );
}
}
if ( s_graphicsoptions.filter.curvalue )
{
@ -835,21 +838,21 @@ static void GraphicsOptions_Event( void* ptr, int event ) {
}
break;
case ID_LIST:
ivo = &s_ivo_templates[s_graphicsoptions.list.curvalue];
s_graphicsoptions.mode.curvalue = GraphicsOptions_FindDetectedResolution(ivo->mode);
s_graphicsoptions.ratio.curvalue =
resToRatio[ s_graphicsoptions.mode.curvalue ];
s_graphicsoptions.tq.curvalue = ivo->tq;
s_graphicsoptions.lighting.curvalue = ivo->lighting;
s_graphicsoptions.colordepth.curvalue = ivo->colordepth;
s_graphicsoptions.texturebits.curvalue = ivo->texturebits;
s_graphicsoptions.geometry.curvalue = ivo->geometry;
s_graphicsoptions.filter.curvalue = ivo->filter;
s_graphicsoptions.fs.curvalue = ivo->fullscreen;
s_graphicsoptions.refreshrate.curvalue = ivo->refreshrate;
break;
// case ID_LIST:
// ivo = &s_ivo_templates[s_graphicsoptions.list.curvalue];
//
// s_graphicsoptions.mode.curvalue = GraphicsOptions_FindDetectedResolution(ivo->mode);
// s_graphicsoptions.ratio.curvalue =
// resToRatio[ s_graphicsoptions.mode.curvalue ];
// s_graphicsoptions.tq.curvalue = ivo->tq;
// s_graphicsoptions.lighting.curvalue = ivo->lighting;
// s_graphicsoptions.colordepth.curvalue = ivo->colordepth;
// s_graphicsoptions.texturebits.curvalue = ivo->texturebits;
// s_graphicsoptions.geometry.curvalue = ivo->geometry;
// s_graphicsoptions.filter.curvalue = ivo->filter;
// s_graphicsoptions.fs.curvalue = ivo->fullscreen;
// s_graphicsoptions.refreshrate.curvalue = ivo->refreshrate;
// break;
case ID_DRIVERINFO:
UI_DriverInfo_Menu();
@ -913,40 +916,40 @@ GraphicsOptions_SetMenuItems
*/
static void GraphicsOptions_SetMenuItems( void )
{
s_graphicsoptions.mode.curvalue =
GraphicsOptions_FindDetectedResolution( trap_Cvar_VariableValue( "r_mode" ) );
if ( s_graphicsoptions.mode.curvalue < 0 )
{
if( resolutionsDetected )
{
int i;
char buf[MAX_STRING_CHARS];
trap_Cvar_VariableStringBuffer("r_customwidth", buf, sizeof(buf)-2);
buf[strlen(buf)+1] = 0;
buf[strlen(buf)] = 'x';
trap_Cvar_VariableStringBuffer("r_customheight", buf+strlen(buf), sizeof(buf)-strlen(buf));
for(i = 0; detectedResolutions[i]; ++i)
{
if(!Q_stricmp(buf, detectedResolutions[i]))
{
s_graphicsoptions.mode.curvalue = i;
break;
}
}
if ( s_graphicsoptions.mode.curvalue < 0 )
s_graphicsoptions.mode.curvalue = 0;
}
else
{
s_graphicsoptions.mode.curvalue = 3;
}
}
s_graphicsoptions.ratio.curvalue =
resToRatio[ s_graphicsoptions.mode.curvalue ];
s_graphicsoptions.fs.curvalue = trap_Cvar_VariableValue("r_fullscreen");
s_graphicsoptions.allow_extensions.curvalue = trap_Cvar_VariableValue("r_allowExtensions");
// s_graphicsoptions.mode.curvalue =
// GraphicsOptions_FindDetectedResolution( trap_Cvar_VariableValue( "r_mode" ) );
//
// if ( s_graphicsoptions.mode.curvalue < 0 )
// {
// if( resolutionsDetected )
// {
// int i;
// char buf[MAX_STRING_CHARS];
// trap_Cvar_VariableStringBuffer("r_customwidth", buf, sizeof(buf)-2);
// buf[strlen(buf)+1] = 0;
// buf[strlen(buf)] = 'x';
// trap_Cvar_VariableStringBuffer("r_customheight", buf+strlen(buf), sizeof(buf)-strlen(buf));
//
// for(i = 0; detectedResolutions[i]; ++i)
// {
// if(!Q_stricmp(buf, detectedResolutions[i]))
// {
// s_graphicsoptions.mode.curvalue = i;
// break;
// }
// }
// if ( s_graphicsoptions.mode.curvalue < 0 )
// s_graphicsoptions.mode.curvalue = 0;
// }
// else
// {
// s_graphicsoptions.mode.curvalue = 3;
// }
// }
// s_graphicsoptions.ratio.curvalue =
// resToRatio[ s_graphicsoptions.mode.curvalue ];
// s_graphicsoptions.fs.curvalue = trap_Cvar_VariableValue("r_fullscreen");
// s_graphicsoptions.allow_extensions.curvalue = trap_Cvar_VariableValue("r_allowExtensions");
s_graphicsoptions.tq.curvalue = 3-trap_Cvar_VariableValue( "r_picmip");
if ( s_graphicsoptions.tq.curvalue < 0 )
{
@ -1004,14 +1007,14 @@ static void GraphicsOptions_SetMenuItems( void )
break;
}
if ( s_graphicsoptions.fs.curvalue == 0 )
{
s_graphicsoptions.colordepth.curvalue = 0;
}
if ( s_graphicsoptions.driver.curvalue == 1 )
{
s_graphicsoptions.colordepth.curvalue = 1;
}
// if ( s_graphicsoptions.fs.curvalue == 0 )
// {
// s_graphicsoptions.colordepth.curvalue = 0;
//}
//if ( s_graphicsoptions.driver.curvalue == 1 )
//{
// s_graphicsoptions.colordepth.curvalue = 1;
// }
switch ( (int) trap_Cvar_VariableValue( "vr_refreshrate" ) )
{
@ -1131,8 +1134,8 @@ void GraphicsOptions_MenuInit( void )
// zero set all our globals
memset( &s_graphicsoptions, 0 ,sizeof(graphicsoptions_t) );
GraphicsOptions_GetResolutions();
GraphicsOptions_GetAspectRatios();
//GraphicsOptions_GetResolutions();
//GraphicsOptions_GetAspectRatios();
GraphicsOptions_Cache();
@ -1203,16 +1206,16 @@ void GraphicsOptions_MenuInit( void )
s_graphicsoptions.network.style = UI_RIGHT;
s_graphicsoptions.network.color = color_red;
y = 254 - 7 * (BIGCHAR_HEIGHT + 2);
s_graphicsoptions.list.generic.type = MTYPE_SPINCONTROL;
s_graphicsoptions.list.generic.name = "Graphics Settings:";
s_graphicsoptions.list.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
s_graphicsoptions.list.generic.x = 400;
s_graphicsoptions.list.generic.y = y;
s_graphicsoptions.list.generic.callback = GraphicsOptions_Event;
s_graphicsoptions.list.generic.id = ID_LIST;
s_graphicsoptions.list.itemnames = s_graphics_options_names;
y += 2 * ( BIGCHAR_HEIGHT + 2 );
y = 254 - 6 * (BIGCHAR_HEIGHT + 2);
// s_graphicsoptions.list.generic.type = MTYPE_SPINCONTROL;
// s_graphicsoptions.list.generic.name = "Graphics Settings:";
// s_graphicsoptions.list.generic.flags = QMF_PULSEIFFOCUS|QMF_SMALLFONT;
// s_graphicsoptions.list.generic.x = 400;
// s_graphicsoptions.list.generic.y = y;
// s_graphicsoptions.list.generic.callback = GraphicsOptions_Event;
// s_graphicsoptions.list.generic.id = ID_LIST;
// s_graphicsoptions.list.itemnames = s_graphics_options_names;
// y += 2 * ( BIGCHAR_HEIGHT + 2 );
// s_graphicsoptions.driver.generic.type = MTYPE_SPINCONTROL;
// s_graphicsoptions.driver.generic.name = "GL Driver:";
@ -1402,7 +1405,7 @@ void GraphicsOptions_MenuInit( void )
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.sound );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.network );
Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.list );
// Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.list );
// Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.driver );
// Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.allow_extensions );
// Menu_AddItem( &s_graphicsoptions.menu, ( void * ) &s_graphicsoptions.ratio );

View file

@ -178,22 +178,22 @@ itemDef {
mouseExit { setitemcolor ctr_graphics backcolor .37 .1 .1 1 }
}
itemDef {
name graphics
group grpSystem
type ITEM_TYPE_MULTI
text "Quality:"
cvar "ui_glCustom"
cvarFloatList { "High Quality" 0 "Normal" 1 "Fast" 2 "Fastest" 3 "Custom" 4 }
rect 0 50 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
textscale .25
forecolor 1 1 1 1
visible 0
action { uiScript update "ui_glCustom" }
}
// itemDef {
// name graphics
// group grpSystem
// type ITEM_TYPE_MULTI
// text "Quality:"
// cvar "ui_glCustom"
// cvarFloatList { "High Quality" 0 "Normal" 1 "Fast" 2 "Fastest" 3 "Custom" 4 }
// rect 0 50 256 20
// textalign ITEM_ALIGN_RIGHT
// textalignx 133
// textaligny 17
// textscale .25
// forecolor 1 1 1 1
// visible 0
// action { uiScript update "ui_glCustom" }
// }
itemDef {
name graphics
@ -202,7 +202,7 @@ itemDef {
text "Refresh Rate:"
cvar "vr_refreshrate"
cvarFloatList { "60" 60 "72 (Recommended)" 72 "80" 80 "90" 90 }
rect 0 70 306 20
rect 0 50 306 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
@ -217,7 +217,7 @@ itemDef {
type ITEM_TYPE_YESNO
text "Sync Every Frame:"
cvar "r_finish"
rect 0 90 256 20
rect 0 70 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
@ -234,7 +234,7 @@ itemDef {
text "Color Depth:"
cvar "r_colorbits"
cvarFloatList { "Desktop Default" 0 "16-bit" 16 "32-bit" 32 }
rect 0 110 256 20
rect 0 90 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
@ -251,7 +251,7 @@ itemDef {
text "Lighting:"
cvar "r_vertexlight"
cvarFloatList { "Light Map (high)" 0 "Vertex (low)" 1 }
rect 0 130 256 20
rect 0 110 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
@ -267,7 +267,7 @@ itemDef {
type ITEM_TYPE_YESNO
text "Dynamic Lights:"
cvar "r_dynamiclight"
rect 0 150 256 20
rect 0 130 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
@ -283,7 +283,7 @@ itemDef {
text "Shadow Detail:"
cvar "cg_shadows"
cvarFloatList { "Low" 1 "High" 3 }
rect 0 170 306 20
rect 0 150 306 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
@ -299,7 +299,7 @@ itemDef {
text "Geometric Detail:"
cvar "r_lodbias"
cvarFloatList { "High" -1 "Medium" 1 "Low" 2 }
rect 0 190 256 20
rect 0 170 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
@ -316,7 +316,7 @@ itemDef {
text "Texture Detail:"
cvar "r_picmip"
cvarFloatList { "Low" 2 "Normal" 1 "High" 0 }
rect 0 210 256 20
rect 0 190 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
@ -333,7 +333,7 @@ itemDef {
text "Texture Quality:"
cvar "r_texturebits"
cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 }
rect 0 230 256 20
rect 0 210 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
@ -349,7 +349,7 @@ itemDef {
text "Texture Filter:"
cvar "r_texturemode"
cvarStrList { "Bilinear", "GL_LINEAR_MIPMAP_NEAREST", "Trilinear", "GL_LINEAR_MIPMAP_LINEAR" }
rect 0 250 256 20
rect 0 230 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17
@ -365,7 +365,7 @@ itemDef {
type ITEM_TYPE_YESNO
text "Compress Textures:"
cvar "r_ext_compressed_textures"
rect 0 270 256 20
rect 0 250 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 133
textaligny 17

View file

@ -82,22 +82,22 @@ itemDef {
}
itemDef {
name graphics
group grpSystem
text "Quality:"
type ITEM_TYPE_MULTI
cvar "ui_glCustom"
cvarFloatList { "High Quality" 0 "Normal" 1 "Fast" 2 "Fastest" 3 "Custom" 4 }
rect 99 42 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
textscale .333
forecolor 1 1 1 1
visible 0
action { uiScript update "ui_glCustom" }
}
// itemDef {
// name graphics
// group grpSystem
// text "Quality:"
// type ITEM_TYPE_MULTI
// cvar "ui_glCustom"
// cvarFloatList { "High Quality" 0 "Normal" 1 "Fast" 2 "Fastest" 3 "Custom" 4 }
// rect 99 42 256 20
// textalign ITEM_ALIGN_RIGHT
// textalignx 128
// textaligny 20
// textscale .333
// forecolor 1 1 1 1
// visible 0
// action { uiScript update "ui_glCustom" }
// }
itemDef {
name graphics
@ -106,7 +106,7 @@ itemDef {
text "Refresh Rate:"
cvar "vr_refreshrate"
cvarFloatList { "60" 60 "72 (Recommended)" 72 "80" 80 "90" 90 }
rect 99 67 256 20
rect 99 42 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -121,7 +121,7 @@ itemDef {
type ITEM_TYPE_YESNO
text "Sync Every Frame:"
cvar "r_finish"
rect 99 92 256 20
rect 99 67 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -137,7 +137,7 @@ itemDef {
text "Color Depth:"
cvar "r_colorbits"
cvarFloatList { "Desktop Default" 0 "16-bit" 16 "32-bit" 32 }
rect 99 117 256 20
rect 99 92 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -154,7 +154,7 @@ itemDef {
text "Lighting:"
cvar "r_vertexlight"
cvarFloatList { "Light Map (high)" 0 "Vertex (low)" 1 }
rect 99 142 256 20
rect 99 117 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -170,7 +170,7 @@ itemDef {
type ITEM_TYPE_YESNO
text "Dynamic Lights:"
cvar "r_dynamiclight"
rect 99 167 256 20
rect 99 142 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -186,7 +186,7 @@ itemDef {
text "Shadow Detail:"
cvar "cg_shadows"
cvarFloatList { "Low" 1 "High" 3 }
rect 99 192 256 20
rect 99 167 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -202,7 +202,7 @@ itemDef {
text "Geometric Detail:"
cvar "r_lodbias"
cvarFloatList { "High" -1 "Medium" 1 "Low" 2 }
rect 99 217 256 20
rect 99 192 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -219,7 +219,7 @@ itemDef {
text "Texture Detail:"
cvar "r_picmip"
cvarFloatList { "Low" 2 "Normal" 1 "High" 0 }
rect 99 242 256 20
rect 99 217 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -236,7 +236,7 @@ itemDef {
text "Texture Quality:"
cvar "r_texturebits"
cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 }
rect 99 267 256 20
rect 99 242 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -252,7 +252,7 @@ itemDef {
text "Texture Filter:"
cvar "r_texturemode"
cvarStrList { "Bilinear", "GL_LINEAR_MIPMAP_NEAREST", "Trilinear", "GL_LINEAR_MIPMAP_LINEAR" }
rect 99 292 256 20
rect 99 267 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20
@ -267,7 +267,7 @@ itemDef {
type ITEM_TYPE_YESNO
text "Compress Textures:"
cvar "r_ext_compressed_textures"
rect 99 317 256 20
rect 99 292 256 20
textalign ITEM_ALIGN_RIGHT
textalignx 128
textaligny 20