diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /materialsystem/shaderlib/shaderlib_cvar.cpp | |
| download | archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip | |
Diffstat (limited to 'materialsystem/shaderlib/shaderlib_cvar.cpp')
| -rw-r--r-- | materialsystem/shaderlib/shaderlib_cvar.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/materialsystem/shaderlib/shaderlib_cvar.cpp b/materialsystem/shaderlib/shaderlib_cvar.cpp new file mode 100644 index 0000000..e84d6fe --- /dev/null +++ b/materialsystem/shaderlib/shaderlib_cvar.cpp @@ -0,0 +1,42 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//===========================================================================// + +#include "icvar.h" +#include "tier1/tier1.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +// ------------------------------------------------------------------------------------------- // +// ConVar stuff. +// ------------------------------------------------------------------------------------------- // +class CShaderLibConVarAccessor : public IConCommandBaseAccessor +{ +public: + virtual bool RegisterConCommandBase( ConCommandBase *pCommand ) + { + // Link to engine's list instead + g_pCVar->RegisterConCommand( pCommand ); + + char const *pValue = g_pCVar->GetCommandLineValue( pCommand->GetName() ); + if( pValue && !pCommand->IsCommand() ) + { + ( ( ConVar * )pCommand )->SetValue( pValue ); + } + return true; + } +}; + +CShaderLibConVarAccessor g_ConVarAccessor; + + +void InitShaderLibCVars( CreateInterfaceFn cvarFactory ) +{ + if ( g_pCVar ) + { + ConVar_Register( FCVAR_MATERIAL_SYSTEM_THREAD, &g_ConVarAccessor ); + } +} |