aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game
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 /sp/src/game
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 'sp/src/game')
-rw-r--r--sp/src/game/client/client_virtualreality.cpp11
-rw-r--r--sp/src/game/client/client_virtualreality.h1
-rw-r--r--sp/src/game/server/cbase.cpp36
3 files changed, 38 insertions, 10 deletions
diff --git a/sp/src/game/client/client_virtualreality.cpp b/sp/src/game/client/client_virtualreality.cpp
index fb6e4417..af52b56e 100644
--- a/sp/src/game/client/client_virtualreality.cpp
+++ b/sp/src/game/client/client_virtualreality.cpp
@@ -261,8 +261,6 @@ CClientVirtualReality::CClientVirtualReality()
m_rtLastMotionSample = 0;
m_bMotionUpdated = false;
- m_bForceVRMode = false;
-
#if defined( USE_SDL )
m_nNonVRSDLDisplayIndex = 0;
#endif
@@ -1367,7 +1365,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 +1439,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 +1508,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();
}
diff --git a/sp/src/game/client/client_virtualreality.h b/sp/src/game/client/client_virtualreality.h
index 3a8c9469..9aadfeb3 100644
--- a/sp/src/game/client/client_virtualreality.h
+++ b/sp/src/game/client/client_virtualreality.h
@@ -147,7 +147,6 @@ private:
int m_iAlignTorsoAndViewToWeaponCountdown;
bool m_bMotionUpdated;
- bool m_bForceVRMode;
RTime32 m_rtLastMotionSample;
diff --git a/sp/src/game/server/cbase.cpp b/sp/src/game/server/cbase.cpp
index d748a1dd..19dd3ac2 100644
--- a/sp/src/game/server/cbase.cpp
+++ b/sp/src/game/server/cbase.cpp
@@ -281,7 +281,11 @@ void CBaseEntityOutput::FireOutput(variant_t Value, CBaseEntity *pActivator, CBa
Q_snprintf( szBuffer,
sizeof(szBuffer),
"(%0.2f) output: (%s,%s) -> (%s,%s,%.1f)(%s)\n",
+#ifdef TF_DLL
engine->GetServerTime(),
+#else
+ gpGlobals->curtime,
+#endif
pCaller ? STRING(pCaller->m_iClassname) : "NULL",
pCaller ? STRING(pCaller->GetEntityName()) : "NULL",
STRING(ev->m_iTarget),
@@ -298,7 +302,11 @@ void CBaseEntityOutput::FireOutput(variant_t Value, CBaseEntity *pActivator, CBa
Q_snprintf( szBuffer,
sizeof(szBuffer),
"(%0.2f) output: (%s,%s) -> (%s,%s)(%s)\n",
+#ifdef TF_DLL
engine->GetServerTime(),
+#else
+ gpGlobals->curtime,
+#endif
pCaller ? STRING(pCaller->m_iClassname) : "NULL",
pCaller ? STRING(pCaller->GetEntityName()) : "NULL", STRING(ev->m_iTarget),
STRING(ev->m_iTargetInput),
@@ -767,7 +775,13 @@ void CEventQueue::Dump( void )
{
EventQueuePrioritizedEvent_t *pe = m_Events.m_pNext;
- Msg( "Dumping event queue. Current time is: %.2f\n", engine->GetServerTime() );
+ Msg("Dumping event queue. Current time is: %.2f\n",
+#ifdef TF_DLL
+ engine->GetServerTime()
+#else
+ gpGlobals->curtime
+#endif
+ );
while ( pe != NULL )
{
@@ -795,7 +809,11 @@ void CEventQueue::AddEvent( const char *target, const char *targetInput, variant
{
// build the new event
EventQueuePrioritizedEvent_t *newEvent = new EventQueuePrioritizedEvent_t;
+#ifdef TF_DLL
newEvent->m_flFireTime = engine->GetServerTime() + fireDelay; // priority key in the priority queue
+#else
+ newEvent->m_flFireTime = gpGlobals->curtime + fireDelay; // priority key in the priority queue
+#endif
newEvent->m_iTarget = MAKE_STRING( target );
newEvent->m_pEntTarget = NULL;
newEvent->m_iTargetInput = MAKE_STRING( targetInput );
@@ -814,7 +832,11 @@ void CEventQueue::AddEvent( CBaseEntity *target, const char *targetInput, varian
{
// build the new event
EventQueuePrioritizedEvent_t *newEvent = new EventQueuePrioritizedEvent_t;
+#ifdef TF_DLL
newEvent->m_flFireTime = engine->GetServerTime() + fireDelay; // primary priority key in the priority queue
+#else
+ newEvent->m_flFireTime = gpGlobals->curtime + fireDelay; // primary priority key in the priority queue
+#endif
newEvent->m_iTarget = NULL_STRING;
newEvent->m_pEntTarget = target;
newEvent->m_iTargetInput = MAKE_STRING( targetInput );
@@ -885,7 +907,11 @@ void CEventQueue::ServiceEvents( void )
EventQueuePrioritizedEvent_t *pe = m_Events.m_pNext;
+#ifdef TF_DLL
while ( pe != NULL && pe->m_flFireTime <= engine->GetServerTime() )
+#else
+ while ( pe != NULL && pe->m_flFireTime <= gpGlobals->curtime )
+#endif
{
MDLCACHE_CRITICAL_SECTION();
@@ -1171,7 +1197,11 @@ int CEventQueue::Restore( IRestore &restore )
AddEvent( tmpEvent.m_pEntTarget,
STRING(tmpEvent.m_iTargetInput),
tmpEvent.m_VariantValue,
+#ifdef TF_DLL
tmpEvent.m_flFireTime - engine->GetServerTime(),
+#else
+ tmpEvent.m_flFireTime - gpGlobals->curtime,
+#endif
tmpEvent.m_pActivator,
tmpEvent.m_pCaller,
tmpEvent.m_iOutputID );
@@ -1181,7 +1211,11 @@ int CEventQueue::Restore( IRestore &restore )
AddEvent( STRING(tmpEvent.m_iTarget),
STRING(tmpEvent.m_iTargetInput),
tmpEvent.m_VariantValue,
+#ifdef TF_DLL
tmpEvent.m_flFireTime - engine->GetServerTime(),
+#else
+ tmpEvent.m_flFireTime - gpGlobals->curtime,
+#endif
tmpEvent.m_pActivator,
tmpEvent.m_pCaller,
tmpEvent.m_iOutputID );