aboutsummaryrefslogtreecommitdiffstats
path: root/code/renderer/tr_init.c
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-12-04 13:37:50 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-12-04 13:37:50 +0000
commit49c94b6250b40c4bd3834f947c9302a33553fae0 (patch)
tree7f33e732c7015550b51c33f8faf49a40fc571f71 /code/renderer/tr_init.c
parent1c365d804a4a71ff34b47540a61f20bbc390ea64 (diff)
downloadioquake3-aero-49c94b6250b40c4bd3834f947c9302a33553fae0.tar.gz
ioquake3-aero-49c94b6250b40c4bd3834f947c9302a33553fae0.zip
* 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 git-svn-id: svn://svn.icculus.org/quake3/trunk@1011 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/renderer/tr_init.c')
-rw-r--r--code/renderer/tr_init.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/code/renderer/tr_init.c b/code/renderer/tr_init.c
index 24016c1..513df4c 100644
--- a/code/renderer/tr_init.c
+++ b/code/renderer/tr_init.c
@@ -132,7 +132,7 @@ cvar_t *r_fullscreen;
cvar_t *r_customwidth;
cvar_t *r_customheight;
-cvar_t *r_customaspect;
+cvar_t *r_customPixelAspect;
cvar_t *r_overBrightBits;
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 ) {
vidmode_t *vm;
+ float pixelAspect;
if ( mode < -1 ) {
return qfalse;
@@ -318,17 +319,18 @@ qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode )
if ( mode == -1 ) {
*width = r_customwidth->integer;
*height = r_customheight->integer;
- *windowAspect = r_customaspect->value;
- return qtrue;
- }
+ pixelAspect = r_customPixelAspect->value;
+ } else {
+ vm = &r_vidModes[mode];
- vm = &r_vidModes[mode];
+ *width = vm->width;
+ *height = vm->height;
+ pixelAspect = vm->pixelAspect;
+ }
- *width = vm->width;
- *height = vm->height;
- *windowAspect = (float)vm->width / ( vm->height * vm->pixelAspect );
+ *windowAspect = (float)*width / ( *height * pixelAspect );
- return qtrue;
+ return qtrue;
}
/*
@@ -943,7 +945,7 @@ void R_Register( void )
#endif
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_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_vertexLight = ri.Cvar_Get( "r_vertexLight", "0", CVAR_ARCHIVE | CVAR_LATCH );
r_uiFullScreen = ri.Cvar_Get( "r_uifullscreen", "0", 0);