aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game/client/cdll_client_int.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sp/src/game/client/cdll_client_int.cpp')
-rw-r--r--sp/src/game/client/cdll_client_int.cpp56
1 files changed, 22 insertions, 34 deletions
diff --git a/sp/src/game/client/cdll_client_int.cpp b/sp/src/game/client/cdll_client_int.cpp
index 0f40f2d3..b5a53e72 100644
--- a/sp/src/game/client/cdll_client_int.cpp
+++ b/sp/src/game/client/cdll_client_int.cpp
@@ -121,7 +121,7 @@
#include "clientsteamcontext.h"
#include "renamed_recvtable_compat.h"
#include "mouthinfo.h"
-#include "headtrack/isourcevirtualreality.h"
+#include "sourcevr/isourcevirtualreality.h"
#include "client_virtualreality.h"
#include "mumble.h"
@@ -148,7 +148,6 @@
#endif
extern vgui::IInputInternal *g_InputInternal;
-const char *COM_GetModDirectory(); // return the mod dir (rather than the complete -game param, which can be a path)
//=============================================================================
// HPE_BEGIN
@@ -332,6 +331,11 @@ static ConVar s_CV_ShowParticleCounts("showparticlecounts", "0", 0, "Display num
static ConVar s_cl_team("cl_team", "default", FCVAR_USERINFO|FCVAR_ARCHIVE, "Default team when joining a game");
static ConVar s_cl_class("cl_class", "default", FCVAR_USERINFO|FCVAR_ARCHIVE, "Default class when joining a game");
+#ifdef HL1MP_CLIENT_DLL
+static ConVar s_cl_load_hl1_content("cl_load_hl1_content", "0", FCVAR_ARCHIVE, "Mount the content from Half-Life: Source if possible");
+#endif
+
+
// Physics system
bool g_bLevelInitialized;
bool g_bTextMode = false;
@@ -943,7 +947,7 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
InitFbx();
#endif
- // it's ok if this is NULL. That just means the headtrack.dll wasn't found
+ // it's ok if this is NULL. That just means the sourcevr.dll wasn't found
g_pSourceVR = (ISourceVirtualReality *)appSystemFactory(SOURCE_VIRTUAL_REALITY_INTERFACE_VERSION, NULL);
factorylist_t factories;
@@ -977,17 +981,6 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
g_pcv_ThreadMode = g_pCVar->FindVar( "host_thread_mode" );
- // If we are in VR mode do some initial setup work
- if( UseVR() )
- {
- int nViewportWidth, nViewportHeight;
-
- g_pSourceVR->GetViewportBounds( ISourceVirtualReality::VREye_Left, NULL, NULL, &nViewportWidth, &nViewportHeight );
- vgui::surface()->SetFullscreenViewport( 0, 0, nViewportWidth, nViewportHeight );
-
- vgui::ivgui()->SetVRMode( true );
- }
-
if (!Initializer::InitializeAllObjects())
return false;
@@ -1091,6 +1084,7 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
#ifndef _X360
HookHapticMessages(); // Always hook the messages
#endif
+
return true;
}
@@ -1141,29 +1135,23 @@ void CHLClient::PostInit()
g_pSixenseInput->PostInit();
#endif
- // If we are in VR mode execute headtrack.cfg in PostInit so all the convars will
- // already be set up
- if( UseVR() )
- {
- // general all-game stuff
- engine->ExecuteClientCmd( "exec headtrack\\headtrack.cfg" );
-
- // game specific VR config
- CUtlString sCmd;
- sCmd.Format( "exec headtrack_%s.cfg", COM_GetModDirectory() );
- engine->ExecuteClientCmd( sCmd.Get() );
+ g_ClientVirtualReality.StartupComplete();
- engine->ExecuteClientCmd( "vr_start_tracking" );
-
- vgui::surface()->SetSoftwareCursor( true );
-#if defined(POSIX)
- ConVarRef m_rawinput( "m_rawinput" );
- m_rawinput.SetValue( 1 );
+#ifdef HL1MP_CLIENT_DLL
+ if ( s_cl_load_hl1_content.GetBool() && steamapicontext && steamapicontext->SteamApps() )
+ {
+ char szPath[ MAX_PATH*2 ];
+ int ccFolder= steamapicontext->SteamApps()->GetAppInstallDir( 280, szPath, sizeof(szPath) );
+ if ( ccFolder > 0 )
+ {
+ V_AppendSlash( szPath, sizeof(szPath) );
+ V_strncat( szPath, "hl1", sizeof( szPath ) );
- ConVarRef mat_vsync( "mat_vsync" );
- mat_vsync.SetValue( 0 );
-#endif
+ g_pFullFileSystem->AddSearchPath( szPath, "HL1" );
+ g_pFullFileSystem->AddSearchPath( szPath, "GAME" );
+ }
}
+#endif
}
//-----------------------------------------------------------------------------