[quake3-commits] r1571 - trunk/code/renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Jun 10 06:41:11 EDT 2009


Author: thilo
Date: 2009-06-10 06:41:11 -0400 (Wed, 10 Jun 2009)
New Revision: 1571

Modified:
   trunk/code/renderer/tr_main.c
Log:
fix code cleanup


Modified: trunk/code/renderer/tr_main.c
===================================================================
--- trunk/code/renderer/tr_main.c	2009-06-10 09:00:31 UTC (rev 1570)
+++ trunk/code/renderer/tr_main.c	2009-06-10 10:41:11 UTC (rev 1571)
@@ -513,19 +513,22 @@
 void R_SetupProjection(viewParms_t *dest, float zProj, qboolean computeFrustum)
 {
 	float	xmin, xmax, ymin, ymax;
-	float	width, height, stereoSep;
+	float	width, height, stereoSep = r_stereoSeparation->value;
 
 	/*
 	 * offset the view origin of the viewer for stereo rendering 
 	 * by setting the projection matrix appropriately.
 	 */
 
-	if(dest->stereoFrame == STEREO_LEFT)
-		stereoSep = zProj / r_stereoSeparation->value;
-	else if(dest->stereoFrame == STEREO_RIGHT)
-		stereoSep = zProj / -r_stereoSeparation->value;
-	else
-		stereoSep = 0;
+	if(stereoSep != 0)
+	{
+		if(dest->stereoFrame == STEREO_LEFT)
+			stereoSep = zProj / stereoSep;
+		else if(dest->stereoFrame == STEREO_RIGHT)
+			stereoSep = zProj / stereoSep;
+		else
+			stereoSep = 0;
+	}
 
 	ymax = zProj * tan(dest->fovY * M_PI / 360.0f);
 	ymin = -ymax;



More information about the quake3-commits mailing list