Counter Strike : Global Offensive Source Code
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.

45 lines
1.2 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=====================================================================================//
  6. #include "icvar.h"
  7. #include "convar.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 CMaterialSystemConVarAccessor : 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. //EAPS3 : Make static.
  29. static CMaterialSystemConVarAccessor g_ConVarAccessor;
  30. void InitMaterialSystemLibCVars( CreateInterfaceFn cvarFactory )
  31. {
  32. if ( g_pCVar )
  33. {
  34. ConVar_Register( 0, &g_ConVarAccessor );
  35. }
  36. }