Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //===========================================================================//
  6. #include "icvar.h"
  7. #include "tier1/tier1.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. // ------------------------------------------------------------------------------------------- //
  11. // ConVar stuff.
  12. // ------------------------------------------------------------------------------------------- //
  13. class CShaderLibConVarAccessor : public IConCommandBaseAccessor
  14. {
  15. public:
  16. virtual bool RegisterConCommandBase( ConCommandBase *pCommand )
  17. {
  18. // Link to engine's list instead
  19. g_pCVar->RegisterConCommand( pCommand );
  20. char const *pValue = g_pCVar->GetCommandLineValue( pCommand->GetName() );
  21. if( pValue && !pCommand->IsCommand() )
  22. {
  23. ( ( ConVar * )pCommand )->SetValue( pValue );
  24. }
  25. return true;
  26. }
  27. };
  28. CShaderLibConVarAccessor g_ConVarAccessor;
  29. void InitShaderLibCVars( CreateInterfaceFn cvarFactory )
  30. {
  31. if ( g_pCVar )
  32. {
  33. ConVar_Register( FCVAR_MATERIAL_SYSTEM_THREAD, &g_ConVarAccessor );
  34. }
  35. }