diff options
author | thilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-05-01 14:56:57 +0000 |
---|---|---|
committer | thilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-05-01 14:56:57 +0000 |
commit | b863dd098c133889a2c66b60218306e2b3b81fb4 (patch) | |
tree | 353a5737cc8fd3d3b22e8fc54217ad960e404186 /code/renderer/tr_main.c | |
parent | e02f31a31c7cf4bccb2bbaaf5cbc0565be173552 (diff) | |
download | ioquake3-aero-b863dd098c133889a2c66b60218306e2b3b81fb4.tar.gz ioquake3-aero-b863dd098c133889a2c66b60218306e2b3b81fb4.zip |
- replace a few constant values with GL macros in tr_cmds.c
- tidy up top of tr_types.h a bit, change flags to hex representation
- make ROM cvar enforcing really work
- remove cg_stereoSeparation from cgame as it is obsolete.
- Add CG_DrawCrosshair3D so people see crosshair correctly when stereoseparation is enabled
git-svn-id: svn://svn.icculus.org/quake3/trunk@1335 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/renderer/tr_main.c')
-rw-r--r-- | code/renderer/tr_main.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/code/renderer/tr_main.c b/code/renderer/tr_main.c index c5996ba..feda105 100644 --- a/code/renderer/tr_main.c +++ b/code/renderer/tr_main.c @@ -456,7 +456,7 @@ void R_SetupFrustum (viewParms_t *dest, float xmin, float xmax, float ymax, floa float oppleg, adjleg, length; int i; - if(stereoSep == 0) + if(stereoSep == 0 && xmin != -xmax) { // symmetric case can be simplified VectorCopy(dest->or.origin, ofsorigin); @@ -513,19 +513,22 @@ R_SetupProjection 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 / r_stereoSeparation->value; + else if(dest->stereoFrame == STEREO_RIGHT) + stereoSep = zProj / -r_stereoSeparation->value; + else + stereoSep = 0; + } ymax = zProj * tan(dest->fovY * M_PI / 360.0f); ymin = -ymax; |