r1011 - trunk/code/renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Dec 4 08:37:50 EST 2006


Author: tma
Date: 2006-12-04 08:37:50 -0500 (Mon, 04 Dec 2006)
New Revision: 1011

Modified:
   trunk/code/renderer/tr_init.c
Log:
* 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


Modified: trunk/code/renderer/tr_init.c
===================================================================
--- trunk/code/renderer/tr_init.c	2006-12-02 23:40:54 UTC (rev 1010)
+++ trunk/code/renderer/tr_init.c	2006-12-04 13:37:50 UTC (rev 1011)
@@ -132,7 +132,7 @@
 
 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 @@
 
 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 @@
 	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];
+
+		*width  = vm->width;
+		*height = vm->height;
+		pixelAspect = vm->pixelAspect;
 	}
 
-	vm = &r_vidModes[mode];
+	*windowAspect = (float)*width / ( *height * pixelAspect );
 
-    *width  = vm->width;
-    *height = vm->height;
-    *windowAspect = (float)vm->width / ( vm->height * vm->pixelAspect );
-
-    return qtrue;
+	return qtrue;
 }
 
 /*
@@ -943,7 +945,7 @@
 #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);




More information about the quake3-commits mailing list