aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/client_virtualreality.cpp
diff options
context:
space:
mode:
authorMichael Sartain <[email protected]>2014-10-02 08:25:55 -0700
committerMichael Sartain <[email protected]>2014-10-02 08:25:55 -0700
commit55ed12f8d1eb6887d348be03aee5573d44177ffb (patch)
tree3686f7ca78c780cd9a3d367b79a9d9250c1be7c0 /mp/src/game/client/client_virtualreality.cpp
parent* Added support for Visual C++ 2013 Express to VPC (diff)
downloadsource-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.tar.xz
source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.zip
Updated the SDK with the latest code from the TF and HL2 branches.
Diffstat (limited to 'mp/src/game/client/client_virtualreality.cpp')
-rw-r--r--mp/src/game/client/client_virtualreality.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/mp/src/game/client/client_virtualreality.cpp b/mp/src/game/client/client_virtualreality.cpp
index fb6e4417..472fa6c1 100644
--- a/mp/src/game/client/client_virtualreality.cpp
+++ b/mp/src/game/client/client_virtualreality.cpp
@@ -213,6 +213,7 @@ void CalcFovFromProjection ( float *pFov, const VMatrix &proj )
Assert ( proj.m[3][2] == -1.0f );
Assert ( proj.m[3][3] == 0.0f );
+ /*
// The math here:
// A view-space vector (x,y,z,1) is transformed by the projection matrix
// / xscale 0 xoffset 0 \
@@ -227,6 +228,7 @@ void CalcFovFromProjection ( float *pFov, const VMatrix &proj )
// = xscale*(x/z) + xoffset (I flipped the signs of both sides)
// => (+-1 - xoffset)/xscale = x/z
// ...and x/z is tan(theta), and theta is the half-FOV.
+ */
float fov_px = 2.0f * RAD2DEG ( atanf ( fabsf ( ( 1.0f - xoffset ) / xscale ) ) );
float fov_nx = 2.0f * RAD2DEG ( atanf ( fabsf ( ( -1.0f - xoffset ) / xscale ) ) );
@@ -261,8 +263,6 @@ CClientVirtualReality::CClientVirtualReality()
m_rtLastMotionSample = 0;
m_bMotionUpdated = false;
- m_bForceVRMode = false;
-
#if defined( USE_SDL )
m_nNonVRSDLDisplayIndex = 0;
#endif
@@ -1367,7 +1367,7 @@ void CClientVirtualReality::Activate()
return;
// These checks don't apply if we're in VR mode because Steam said so.
- if ( !m_bForceVRMode )
+ if ( !ShouldForceVRActive() )
{
// see if VR mode is even enabled
if ( materials->GetCurrentConfigForVideoCard().m_nVRModeAdapter == -1 )
@@ -1441,7 +1441,7 @@ void CClientVirtualReality::Activate()
vgui::ivgui()->SetVRMode( true );
// we can skip this extra mode change if we've always been in VR mode
- if ( !m_bForceVRMode )
+ if ( !ShouldForceVRActive() )
{
VRRect_t rect;
if ( g_pSourceVR->GetDisplayBounds( &rect ) )
@@ -1510,10 +1510,7 @@ void CClientVirtualReality::Deactivate()
// Called when startup is complete
void CClientVirtualReality::StartupComplete()
{
- if ( g_pSourceVR )
- m_bForceVRMode = g_pSourceVR->ShouldForceVRMode();
-
- if ( vr_activate_default.GetBool( ) || m_bForceVRMode )
+ if ( vr_activate_default.GetBool() || ShouldForceVRActive() )
Activate();
}