* Add r_customPixelAspect to support displays with non 1:1 pixel aspects (do

such things exist?)
* Remove r_customaspect as its value is implied through the other three
  r_custom cvars
This commit is contained in:
Tim Angus 2006-12-04 13:37:50 +00:00
parent 17c443a3fd
commit bd9e7c4b8f
1 changed files with 12 additions and 10 deletions

View File

@ -132,7 +132,7 @@ cvar_t *r_fullscreen;
cvar_t *r_customwidth; cvar_t *r_customwidth;
cvar_t *r_customheight; cvar_t *r_customheight;
cvar_t *r_customaspect; cvar_t *r_customPixelAspect;
cvar_t *r_overBrightBits; cvar_t *r_overBrightBits;
cvar_t *r_mapOverBrightBits; cvar_t *r_mapOverBrightBits;
@ -307,6 +307,7 @@ static int s_numVidModes = ( sizeof( r_vidModes ) / sizeof( r_vidModes[0] ) );
qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode ) { qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode ) {
vidmode_t *vm; vidmode_t *vm;
float pixelAspect;
if ( mode < -1 ) { if ( mode < -1 ) {
return qfalse; return qfalse;
@ -318,15 +319,16 @@ qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode )
if ( mode == -1 ) { if ( mode == -1 ) {
*width = r_customwidth->integer; *width = r_customwidth->integer;
*height = r_customheight->integer; *height = r_customheight->integer;
*windowAspect = r_customaspect->value; pixelAspect = r_customPixelAspect->value;
return qtrue; } else {
}
vm = &r_vidModes[mode]; vm = &r_vidModes[mode];
*width = vm->width; *width = vm->width;
*height = vm->height; *height = vm->height;
*windowAspect = (float)vm->width / ( vm->height * vm->pixelAspect ); pixelAspect = vm->pixelAspect;
}
*windowAspect = (float)*width / ( *height * pixelAspect );
return qtrue; return qtrue;
} }
@ -943,7 +945,7 @@ void R_Register( void )
#endif #endif
r_customwidth = ri.Cvar_Get( "r_customwidth", "1600", CVAR_ARCHIVE | CVAR_LATCH ); r_customwidth = ri.Cvar_Get( "r_customwidth", "1600", CVAR_ARCHIVE | CVAR_LATCH );
r_customheight = ri.Cvar_Get( "r_customheight", "1024", CVAR_ARCHIVE | CVAR_LATCH ); r_customheight = ri.Cvar_Get( "r_customheight", "1024", CVAR_ARCHIVE | CVAR_LATCH );
r_customaspect = ri.Cvar_Get( "r_customaspect", "1", CVAR_ARCHIVE | CVAR_LATCH ); r_customPixelAspect = ri.Cvar_Get( "r_customPixelAspect", "1", CVAR_ARCHIVE | CVAR_LATCH );
r_simpleMipMaps = ri.Cvar_Get( "r_simpleMipMaps", "1", CVAR_ARCHIVE | CVAR_LATCH ); r_simpleMipMaps = ri.Cvar_Get( "r_simpleMipMaps", "1", CVAR_ARCHIVE | CVAR_LATCH );
r_vertexLight = ri.Cvar_Get( "r_vertexLight", "0", CVAR_ARCHIVE | CVAR_LATCH ); r_vertexLight = ri.Cvar_Get( "r_vertexLight", "0", CVAR_ARCHIVE | CVAR_LATCH );
r_uiFullScreen = ri.Cvar_Get( "r_uifullscreen", "0", 0); r_uiFullScreen = ri.Cvar_Get( "r_uifullscreen", "0", 0);